X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F060_compat%2F001_module_refresh_compat.t;h=dbf6f0736584df5697f3f6103a9c12779cdc2196;hb=refs%2Fheads%2Fabandoned%2Fdeath_to_all_ellipses;hp=ab139a0ba0f27b6c7a13f0e18042f1c46e8bbc6f;hpb=e59a5c292a333cac504b65ebd4bba20b5e98d796;p=gitmo%2FMoose.git diff --git a/t/060_compat/001_module_refresh_compat.t b/t/060_compat/001_module_refresh_compat.t index ab139a0..dbf6f07 100644 --- a/t/060_compat/001_module_refresh_compat.t +++ b/t/060_compat/001_module_refresh_compat.t @@ -10,26 +10,26 @@ use Test::Exception; BEGIN { eval "use Module::Refresh;"; - plan skip_all => "Module::Refresh is required for this test" if $@; - plan tests => 23; + plan skip_all => "Module::Refresh is required for this test" if $@; + plan tests => 23; } =pod First lets test some of our simple example modules ... -=cut +=cut my @modules = qw[Foo Bar MyMooseA MyMooseB MyMooseObject]; do { use_ok($_); - - is($_->meta->name, $_, '... initialized the meta correctly'); - + + is($_->meta->name, $_, 'initialized the meta correctly'); + lives_ok { Module::Refresh->new->refresh_module($_ . '.pm') - } '... successfully refreshed ' . $_; + } 'successfully refreshed ' . $_; } foreach @modules; =pod @@ -57,19 +57,19 @@ has 'foo' => (is => 'rw', isa => 'Int'); |; { - open FILE, ">", $test_module_file + open FILE, ">", $test_module_file || die "Could not open $test_module_file because $!"; print FILE $test_module_source_1; close FILE; } use_ok('TestBaz'); -is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly'); -ok(TestBaz->meta->has_attribute('foo'), '... it has the foo attribute as well'); -ok(!TestBaz->isa('Foo'), '... TestBaz is not a Foo'); +is(TestBaz->meta->name, 'TestBaz', 'initialized the meta correctly'); +ok(TestBaz->meta->has_attribute('foo'), 'it has the foo attribute as well'); +ok(!TestBaz->isa('Foo'), 'TestBaz is not a Foo'); { - open FILE, ">", $test_module_file + open FILE, ">", $test_module_file || die "Could not open $test_module_file because $!"; print FILE $test_module_source_2; close FILE; @@ -77,11 +77,11 @@ ok(!TestBaz->isa('Foo'), '... TestBaz is not a Foo'); lives_ok { Module::Refresh->new->refresh_module($test_module_file) -} '... successfully refreshed ' . $test_module_file; +} 'successfully refreshed ' . $test_module_file; -is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly'); -ok(TestBaz->meta->has_attribute('foo'), '... it has the foo attribute as well'); -ok(TestBaz->isa('Foo'), '... TestBaz is a Foo'); +is(TestBaz->meta->name, 'TestBaz', 'initialized the meta correctly'); +ok(TestBaz->meta->has_attribute('foo'), 'it has the foo attribute as well'); +ok(TestBaz->isa('Foo'), 'TestBaz is a Foo'); unlink $test_module_file;