use Test::More;
use Test::Exception;
+use MetaTest;
+
BEGIN {
eval "use Module::Refresh;";
plan skip_all => "Module::Refresh is required for this test" if $@;
do {
use_ok($_);
- is($_->meta->name, $_, '... initialized the meta correctly');
+ skip_meta {
+ is($_->meta->name, $_, '... initialized the meta correctly');
+ } 1;
lives_ok {
Module::Refresh->new->refresh_module($_ . '.pm')
}
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');
+skip_meta {
+ is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly');
+ ok(TestBaz->meta->has_attribute('foo'), '... it has the foo attribute as well');
+} 2;
ok(!TestBaz->isa('Foo'), '... TestBaz is not a Foo');
{
Module::Refresh->new->refresh_module($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');
+skip_meta {
+ is(TestBaz->meta->name, 'TestBaz', '... initialized the meta correctly');
+ ok(TestBaz->meta->has_attribute('foo'), '... it has the foo attribute as well');
+} 2;
ok(TestBaz->isa('Foo'), '... TestBaz is a Foo');
unlink $test_module_file;
use strict;
use warnings;
+use lib 't/lib';
+
use Test::More tests => 6;
use Test::Exception;
+use MetaTest;
+
+# this is so that when we use base 'Foo' below we won't get the Foo.pm in t/lib
+BEGIN {
+ @INC = grep { $_ ne 't/lib' } @INC;
+};
+
=pod
use base 'Foo';
}
-my $bar = Bar->new;
-isa_ok($bar, 'Bar');
-isa_ok($bar, 'Foo');
-ok(!$bar->isa('Moose::Object'), '... Bar is not Moose::Object subclass');
+skip_meta {
+ my $bar = Bar->new;
+ isa_ok($bar, 'Bar');
+ isa_ok($bar, 'Foo');
+ ok(!$bar->isa('Moose::Object'), '... Bar is not Moose::Object subclass');
+} 3;
my $baz = Baz->new;
isa_ok($baz, 'Baz');