From: Arthur Axel 'fREW' Schmidt Date: Sat, 5 Sep 2009 21:53:02 +0000 (-0500) Subject: skip meta tests for 030 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50421930b31ded17d37ffc9005adb63989ec8cbe;p=gitmo%2FMoose.git skip meta tests for 030 --- diff --git a/t/030_roles/002_role.t b/t/030_roles/002_role.t index 70c31a2..481fe04 100644 --- a/t/030_roles/002_role.t +++ b/t/030_roles/002_role.t @@ -3,9 +3,14 @@ use strict; use warnings; -use Test::More tests => 41; +use lib 't/lib'; + +use Test::More; use Test::Exception; +use MetaTest; + +skip_all_meta 41; =pod NOTE: diff --git a/t/030_roles/003_apply_role.t b/t/030_roles/003_apply_role.t index 1ccff67..59a7a68 100644 --- a/t/030_roles/003_apply_role.t +++ b/t/030_roles/003_apply_role.t @@ -3,9 +3,15 @@ use strict; use warnings; -use Test::More tests => 86; +use lib 't/lib'; + +use Test::More; use Test::Exception; +use MetaTest; + +skip_all_meta 86; + { package FooRole; use Moose::Role; diff --git a/t/030_roles/004_role_composition_errors.t b/t/030_roles/004_role_composition_errors.t index ce8918f..a16eea2 100644 --- a/t/030_roles/004_role_composition_errors.t +++ b/t/030_roles/004_role_composition_errors.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 14; use Test::Exception; +use MetaTest; { @@ -15,12 +18,13 @@ use Test::Exception; requires 'foo'; } - -is_deeply( - [ sort Foo::Role->meta->get_required_method_list ], - ['foo'], - '... the Foo::Role has a required method (foo)' -); +skip_meta { + is_deeply( + [ sort Foo::Role->meta->get_required_method_list ], + ['foo'], + '... the Foo::Role has a required method (foo)' + ); +} 1; # classes which does not implement required method { @@ -57,12 +61,13 @@ is_deeply( sub foo {'Bar::Role::foo'} } - -is_deeply( - [ sort Bar::Role->meta->get_required_method_list ], - [], - '... the Bar::Role has not inherited the required method from Foo::Role' -); +skip_meta { + is_deeply( + [ sort Bar::Role->meta->get_required_method_list ], + [], + '... the Bar::Role has not inherited the required method from Foo::Role' + ); +} 1; # role which does not implement required method { @@ -73,12 +78,13 @@ is_deeply( ::lives_ok { with('Foo::Role') } '... no foo method implemented by Baz::Role'; } - -is_deeply( - [ sort Baz::Role->meta->get_required_method_list ], - ['foo'], - '... the Baz::Role has inherited the required method from Foo::Role' -); +skip_meta { + is_deeply( + [ sort Baz::Role->meta->get_required_method_list ], + ['foo'], + '... the Baz::Role has inherited the required method from Foo::Role' + ); +} 1; # classes which does not implement required method { diff --git a/t/030_roles/005_role_conflict_detection.t b/t/030_roles/005_role_conflict_detection.t index 7da76ad..36eb649 100644 --- a/t/030_roles/005_role_conflict_detection.t +++ b/t/030_roles/005_role_conflict_detection.t @@ -3,9 +3,13 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 88; use Test::Exception; +use MetaTest; + =pod Mutually recursive roles. @@ -69,13 +73,13 @@ is($test2->foo, 'Role::Bar::foo', '... $test2->foo worked'); is($test2->bar, 'Role::Foo::bar', '... $test2->bar worked'); # check some meta-stuff +skip_meta { + ok(Role::Foo->meta->has_method('bar'), '... it still has the bar method'); + ok(Role::Foo->meta->requires_method('foo'), '... it still has the required foo method'); -ok(Role::Foo->meta->has_method('bar'), '... it still has the bar method'); -ok(Role::Foo->meta->requires_method('foo'), '... it still has the required foo method'); - -ok(Role::Bar->meta->has_method('foo'), '... it still has the foo method'); -ok(Role::Bar->meta->requires_method('bar'), '... it still has the required bar method'); - + ok(Role::Bar->meta->has_method('foo'), '... it still has the foo method'); + ok(Role::Bar->meta->requires_method('bar'), '... it still has the required bar method'); +} 4; =pod Role method conflicts @@ -128,10 +132,12 @@ Role method conflicts sub bling { 'My::Test6::bling' } } -ok(!My::Test3->meta->has_method('bling'), '... we didnt get any methods in the conflict'); -ok(My::Test4->meta->has_method('bling'), '... we did get the method when manually dealt with'); -ok(My::Test5->meta->has_method('bling'), '... we did get the method when manually dealt with'); -ok(My::Test6->meta->has_method('bling'), '... we did get the method when manually dealt with'); +skip_meta { + ok(!My::Test3->meta->has_method('bling'), '... we didnt get any methods in the conflict'); + ok(My::Test4->meta->has_method('bling'), '... we did get the method when manually dealt with'); + ok(My::Test5->meta->has_method('bling'), '... we did get the method when manually dealt with'); + ok(My::Test6->meta->has_method('bling'), '... we did get the method when manually dealt with'); +} 4; ok(!My::Test3->does('Role::Bling'), '... our class does() the correct roles'); ok(!My::Test3->does('Role::Bling::Bling'), '... our class does() the correct roles'); @@ -156,13 +162,14 @@ is(My::Test6->bling, 'My::Test6::bling', '... and we got the local method'); sub bling { 'Role::Bling::Bling::Bling::bling' } } - -ok(Role::Bling::Bling->meta->has_method('bling'), '... still got the bling method in Role::Bling::Bling'); -ok(Role::Bling::Bling->meta->does_role('Role::Bling::Bling'), '... our role correctly does() the other role'); -ok(Role::Bling::Bling::Bling->meta->has_method('bling'), '... dont have the bling method in Role::Bling::Bling::Bling'); -is(Role::Bling::Bling::Bling->meta->get_method('bling')->(), - 'Role::Bling::Bling::Bling::bling', - '... still got the bling method in Role::Bling::Bling::Bling'); +skip_meta { + ok(Role::Bling::Bling->meta->has_method('bling'), '... still got the bling method in Role::Bling::Bling'); + ok(Role::Bling::Bling->meta->does_role('Role::Bling::Bling'), '... our role correctly does() the other role'); + ok(Role::Bling::Bling::Bling->meta->has_method('bling'), '... dont have the bling method in Role::Bling::Bling::Bling'); + is(Role::Bling::Bling::Bling->meta->get_method('bling')->(), + 'Role::Bling::Bling::Bling::bling', + '... still got the bling method in Role::Bling::Bling::Bling'); +} 4; =pod @@ -220,11 +227,12 @@ Role attribute conflicts } -ok(!My::Test7->meta->has_attribute('ghost'), '... we didnt get any attributes in the conflict'); -ok(My::Test8->meta->has_attribute('ghost'), '... we did get an attributes when manually composed'); -ok(My::Test9->meta->has_attribute('ghost'), '... we did get an attributes when manually composed'); -ok(My::Test10->meta->has_attribute('ghost'), '... we did still have an attribute ghost (conflict does not mess with class)'); - +skip_meta { + ok(!My::Test7->meta->has_attribute('ghost'), '... we didnt get any attributes in the conflict'); + ok(My::Test8->meta->has_attribute('ghost'), '... we did get an attributes when manually composed'); + ok(My::Test9->meta->has_attribute('ghost'), '... we did get an attributes when manually composed'); + ok(My::Test10->meta->has_attribute('ghost'), '... we did still have an attribute ghost (conflict does not mess with class)'); +} 4; ok(!My::Test7->does('Role::Boo'), '... our class does() the correct roles'); ok(!My::Test7->does('Role::Boo::Hoo'), '... our class does() the correct roles'); ok(My::Test8->does('Role::Boo'), '... our class does() the correct roles'); @@ -305,11 +313,12 @@ Role override method conflicts } qr/Two \'override\' methods of the same name encountered/, '... cannot compose it because we have no superclass'; } - -ok(My::Test11->meta->has_method('twist'), '... the twist method has been added'); -ok(My::Test12->meta->has_method('twist'), '... the twist method has been added'); -ok(!My::Test13->meta->has_method('twist'), '... the twist method has not been added'); -ok(!My::Test14->meta->has_method('twist'), '... the twist method has not been added'); +skip_meta { + ok(My::Test11->meta->has_method('twist'), '... the twist method has been added'); + ok(My::Test12->meta->has_method('twist'), '... the twist method has been added'); + ok(!My::Test13->meta->has_method('twist'), '... the twist method has not been added'); + ok(!My::Test14->meta->has_method('twist'), '... the twist method has not been added'); +} 4; ok(!My::Test11->does('Role::Plot'), '... our class does() the correct roles'); ok(My::Test11->does('Role::Truth'), '... our class does() the correct roles'); @@ -338,11 +347,13 @@ is(My::Test14->twist(), 'My::Test::Base::twist', '... got the right method retur } } -ok(Role::Reality->meta->has_method('twist'), '... the twist method has not been added'); -#ok(!Role::Reality->meta->does_role('Role::Plot'), '... our role does() the correct roles'); -is(Role::Reality->meta->get_method('twist')->(), - 'Role::Reality::twist', - '... the twist method returns the right value'); +skip_meta { + ok(Role::Reality->meta->has_method('twist'), '... the twist method has not been added'); + #ok(!Role::Reality->meta->does_role('Role::Plot'), '... our role does() the correct roles'); + is(Role::Reality->meta->get_method('twist')->(), + 'Role::Reality::twist', + '... the twist method returns the right value'); +} 2; # Ovid's test case from rt.cpan.org #44 { diff --git a/t/030_roles/006_role_exclusion.t b/t/030_roles/006_role_exclusion.t index 762cefd..fabc431 100644 --- a/t/030_roles/006_role_exclusion.t +++ b/t/030_roles/006_role_exclusion.t @@ -3,9 +3,15 @@ use strict; use warnings; -use Test::More tests => 22; +use lib 't/lib'; + +use Test::More; use Test::Exception; +use MetaTest; + +skip_all_meta 22; + =pod The idea and examples for this feature are taken diff --git a/t/030_roles/007_roles_and_req_method_edge_cases.t b/t/030_roles/007_roles_and_req_method_edge_cases.t index b99348b..e6cc74b 100644 --- a/t/030_roles/007_roles_and_req_method_edge_cases.t +++ b/t/030_roles/007_roles_and_req_method_edge_cases.t @@ -3,9 +3,13 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 15; use Test::Exception; +use MetaTest; + =pod NOTE: @@ -42,10 +46,12 @@ not remove the requirement) override 'foo' => sub { 'Role::ProvideFoo::foo' }; } -is_deeply( - [ Role::ProvideFoo->meta->get_required_method_list ], - [ 'foo' ], - '... foo method is still required for Role::ProvideFoo'); +skip_meta { + is_deeply( + [ Role::ProvideFoo->meta->get_required_method_list ], + [ 'foo' ], + '... foo method is still required for Role::ProvideFoo'); +} 1; =pod @@ -132,13 +138,14 @@ method modifier. use Moose; extends 'Class::ProvideFoo::Base'; - + use MetaTest; sub foo { 'Class::ProvideFoo::foo' } before 'foo' => sub { 'Class::ProvideFoo::foo:before' }; - - ::isa_ok(__PACKAGE__->meta->get_method('foo'), 'Class::MOP::Method::Wrapped'); - ::is(__PACKAGE__->meta->get_method('foo')->get_original_method->package_name, __PACKAGE__, - '... but the original method is from our package'); + skip_meta { + ::isa_ok(__PACKAGE__->meta->get_method('foo'), 'Class::MOP::Method::Wrapped'); + ::is(__PACKAGE__->meta->get_method('foo')->get_original_method->package_name, __PACKAGE__, + '... but the original method is from our package'); + } 2; ::lives_ok { with 'Role::RequireFoo'; diff --git a/t/030_roles/008_role_conflict_edge_cases.t b/t/030_roles/008_role_conflict_edge_cases.t index 22cc706..1d4039e 100644 --- a/t/030_roles/008_role_conflict_edge_cases.t +++ b/t/030_roles/008_role_conflict_edge_cases.t @@ -3,9 +3,15 @@ use strict; use warnings; -use Test::More tests => 32; +use lib 't/lib'; + +use Test::More; use Test::Exception; +use MetaTest; + +skip_all_meta 32; + =pod Check for repeated inheritance causing diff --git a/t/030_roles/009_more_role_edge_cases.t b/t/030_roles/009_more_role_edge_cases.t index e9923f0..c69e7be 100644 --- a/t/030_roles/009_more_role_edge_cases.t +++ b/t/030_roles/009_more_role_edge_cases.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 74; use Test::Exception; +use MetaTest; { @@ -116,8 +119,9 @@ use Test::Exception; lives_ok { $i->foo } '... called foo successfully (again)'; is( $i->counter, 2, "after hook called (again)" ); - - ok(SubBA->meta->has_method('foo'), '... this has the foo method'); + skip_meta { + ok(SubBA->meta->has_method('foo'), '... this has the foo method'); + } 1; #my $subba_foo_rv; #lives_ok { # $subba_foo_rv = SubBA::foo(); diff --git a/t/030_roles/010_run_time_role_composition.t b/t/030_roles/010_run_time_role_composition.t index 08354c5..f9848a4 100644 --- a/t/030_roles/010_run_time_role_composition.t +++ b/t/030_roles/010_run_time_role_composition.t @@ -3,10 +3,15 @@ use strict; use warnings; -use Test::More tests => 27; +use lib 't/lib'; + +use Test::More; use Scalar::Util qw(blessed); +use MetaTest; + +skip_all_meta 27; =pod diff --git a/t/030_roles/011_overriding.t b/t/030_roles/011_overriding.t index 32bd113..347e518 100644 --- a/t/030_roles/011_overriding.t +++ b/t/030_roles/011_overriding.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 39; use Test::Exception; +use MetaTest; { @@ -76,7 +79,9 @@ is( Class::A->new->xxy, "Role::B::xxy", "... got the right xxy method" ); sub bar { 'Class::A::Resolved::bar' } } -ok(Role::A::Conflict->meta->requires_method('bar'), '... Role::A::Conflict created the bar requirement'); +skip_meta { + ok(Role::A::Conflict->meta->requires_method('bar'), '... Role::A::Conflict created the bar requirement'); +} 1; can_ok( Class::A::Resolved->new, qw(bar) ); @@ -125,7 +130,9 @@ is( Class::B->new->zot, "Class::B::zot", "... got the &zot method okay" ); is( Class::B->new->bar, "Role::D::bar", "... got the &bar method okay" ); is( Class::B->new->xxy, "Role::E::xxy", "... got the &xxy method okay" ); -ok(!Role::F->meta->requires_method('foo'), '... Role::F fufilled the &foo requirement'); +skip_meta { + ok(!Role::F->meta->requires_method('foo'), '... Role::F fufilled the &foo requirement'); +} 1; { # check that a conflict can be resolved @@ -147,9 +154,11 @@ ok(!Role::F->meta->requires_method('foo'), '... Role::F fufilled the &foo requir } -ok(!Role::D::And::E::Conflict->meta->requires_method('foo'), '... Role::D::And::E::Conflict fufilled the &foo requirement'); -ok(Role::D::And::E::Conflict->meta->requires_method('xxy'), '... Role::D::And::E::Conflict adds the &xxy requirement'); -ok(Role::D::And::E::Conflict->meta->requires_method('bar'), '... Role::D::And::E::Conflict adds the &bar requirement'); +skip_meta { + ok(!Role::D::And::E::Conflict->meta->requires_method('foo'), '... Role::D::And::E::Conflict fufilled the &foo requirement'); + ok(Role::D::And::E::Conflict->meta->requires_method('xxy'), '... Role::D::And::E::Conflict adds the &xxy requirement'); + ok(Role::D::And::E::Conflict->meta->requires_method('bar'), '... Role::D::And::E::Conflict adds the &bar requirement'); +} 3; { # conflict propagation @@ -203,7 +212,9 @@ is( Class::E->new->zot, "Class::E::zot", "... got the right &zot method" ); is( Class::E->new->bar, "Role::H::bar", "... got the right &bar method" ); is( Class::E->new->xxy, "Role::J::xxy", "... got the right &xxy method" ); -ok(Role::I->meta->requires_method('foo'), '... Role::I still have the &foo requirement'); +skip_meta { + ok(Role::I->meta->requires_method('foo'), '... Role::I still have the &foo requirement'); +} 1; { lives_ok { diff --git a/t/030_roles/012_method_exclusion_in_composition.t b/t/030_roles/012_method_exclusion_in_composition.t index 8c3456e..0f6dae7 100644 --- a/t/030_roles/012_method_exclusion_in_composition.t +++ b/t/030_roles/012_method_exclusion_in_composition.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 19; use Test::Exception; +use MetaTest; { @@ -22,8 +25,10 @@ use Test::Exception; with 'My::Role' => { -excludes => 'bar' }; } -ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz); -ok(!My::Class->meta->has_method('bar'), '... but we excluded bar'); +skip_meta { + ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz); + ok(!My::Class->meta->has_method('bar'), '... but we excluded bar'); +} 3; { package My::OtherRole; @@ -35,10 +40,12 @@ ok(!My::Class->meta->has_method('bar'), '... but we excluded bar'); sub bar { 'My::OtherRole::bar' } } -ok(My::OtherRole->meta->has_method($_), "we have a $_ method") for qw(foo bar baz); +skip_meta { + ok(My::OtherRole->meta->has_method($_), "we have a $_ method") for qw(foo bar baz); -ok(!My::OtherRole->meta->requires_method('foo'), '... and the &foo method is not required'); -ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is required'); + ok(!My::OtherRole->meta->requires_method('foo'), '... and the &foo method is not required'); + ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is required'); +} 5; { package Foo::Role; @@ -94,8 +101,10 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ } '... composed our roles correctly'; } -ok(My::Foo::Role->meta->has_method('foo'), "we have a foo method"); -ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not required'); +skip_meta { + ok(My::Foo::Role->meta->has_method('foo'), "we have a foo method"); + ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not required'); +} 2; { package My::Foo::Role::Other; @@ -108,8 +117,10 @@ ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not } '... composed our roles correctly'; } -ok(!My::Foo::Role::Other->meta->has_method('foo'), "we dont have a foo method"); -ok(My::Foo::Role::Other->meta->requires_method('foo'), '... and the &foo method is required'); +skip_meta { + ok(!My::Foo::Role::Other->meta->has_method('foo'), "we dont have a foo method"); + ok(My::Foo::Role::Other->meta->requires_method('foo'), '... and the &foo method is required'); +} 2; diff --git a/t/030_roles/013_method_aliasing_in_composition.t b/t/030_roles/013_method_aliasing_in_composition.t index d16ff10..62bb8ff 100644 --- a/t/030_roles/013_method_aliasing_in_composition.t +++ b/t/030_roles/013_method_aliasing_in_composition.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 35; use Test::Exception; +use MetaTest; { @@ -35,7 +38,9 @@ use Test::Exception; sub role_bar { 'FAIL' } } -ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz bar role_bar); +skip_meta { + ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz bar role_bar); +} 4; { package My::OtherRole; @@ -57,9 +62,11 @@ ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz bar ro sub role_bar { 'FAIL' } } -ok(My::OtherRole->meta->has_method($_), "we have a $_ method") for qw(foo baz role_bar); -ok(!My::OtherRole->meta->requires_method('bar'), '... and the &bar method is not required'); -ok(!My::OtherRole->meta->requires_method('role_bar'), '... and the &role_bar method is not required'); +skip_meta { + ok(My::OtherRole->meta->has_method($_), "we have a $_ method") for qw(foo baz role_bar); + ok(!My::OtherRole->meta->requires_method('bar'), '... and the &bar method is not required'); + ok(!My::OtherRole->meta->requires_method('role_bar'), '... and the &role_bar method is not required'); +} 5; { package My::AliasingRole; @@ -70,8 +77,10 @@ ok(!My::OtherRole->meta->requires_method('role_bar'), '... and the &role_bar met } '... this succeeds'; } -ok(My::AliasingRole->meta->has_method($_), "we have a $_ method") for qw(foo baz role_bar); -ok(My::AliasingRole->meta->requires_method('bar'), '... and the &bar method is required'); +skip_meta { + ok(My::AliasingRole->meta->has_method($_), "we have a $_ method") for qw(foo baz role_bar); + ok(My::AliasingRole->meta->requires_method('bar'), '... and the &bar method is required'); +} 4; { package Foo::Role; @@ -129,8 +138,10 @@ ok(My::AliasingRole->meta->requires_method('bar'), '... and the &bar method is r } '... composed our roles correctly'; } -ok(My::Foo::Role->meta->has_method($_), "we have a $_ method") for qw/foo foo_foo bar_foo/;; -ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not required'); +skip_meta { + ok(My::Foo::Role->meta->has_method($_), "we have a $_ method") for qw/foo foo_foo bar_foo/;; + ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not required'); +} 4; { @@ -143,7 +154,8 @@ ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not 'Baz::Role'; } '... composed our roles correctly'; } - -ok(!My::Foo::Role::Other->meta->has_method('foo_foo'), "we dont have a foo_foo method"); -ok(My::Foo::Role::Other->meta->requires_method('foo_foo'), '... and the &foo method is required'); +skip_meta { + ok(!My::Foo::Role::Other->meta->has_method('foo_foo'), "we dont have a foo_foo method"); + ok(My::Foo::Role::Other->meta->requires_method('foo_foo'), '... and the &foo method is required'); +} 2; diff --git a/t/030_roles/015_runtime_roles_and_attrs.t b/t/030_roles/015_runtime_roles_and_attrs.t index 55a3847..fb2caac 100644 --- a/t/030_roles/015_runtime_roles_and_attrs.t +++ b/t/030_roles/015_runtime_roles_and_attrs.t @@ -3,10 +3,13 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 11; use Test::Exception; use Scalar::Util 'blessed'; +use MetaTest; @@ -42,16 +45,18 @@ dies_ok { $obj->dog($obj) } '... and setting the accessor fails (not a Dog yet)'; -Dog->meta->apply($obj); +skip_meta { + Dog->meta->apply($obj); -ok($obj->does('Dog'), '... we now do the Bark role'); -ok($obj->can('talk'), "... the role is now composed at the object level"); -ok($obj->can('fur'), "it has fur"); + ok($obj->does('Dog'), '... we now do the Bark role'); + ok($obj->can('talk'), "... the role is now composed at the object level"); + ok($obj->can('fur'), "it has fur"); -is($obj->talk, 'woof', '... got the right return value for the newly composed method'); + is($obj->talk, 'woof', '... got the right return value for the newly composed method'); -lives_ok { - $obj->dog($obj) -} '... and setting the accessor is okay'; + lives_ok { + $obj->dog($obj) + } '... and setting the accessor is okay'; -is($obj->fur, "dirty", "role attr initialized"); + is($obj->fur, "dirty", "role attr initialized"); +} 6; diff --git a/t/030_roles/016_runtime_roles_and_nonmoose.t b/t/030_roles/016_runtime_roles_and_nonmoose.t index be31150..c77d785 100644 --- a/t/030_roles/016_runtime_roles_and_nonmoose.t +++ b/t/030_roles/016_runtime_roles_and_nonmoose.t @@ -3,10 +3,13 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 7; use Test::Exception; use Scalar::Util 'blessed'; +use MetaTest; @@ -45,13 +48,14 @@ dies_ok { $foo->dog($bar) } '... and setting the accessor fails (not a Dog yet)'; -Dog->meta->apply($bar); - -ok($bar->can('talk'), "... the role is now composed at the object level"); +skip_meta { + Dog->meta->apply($bar); -is($bar->talk, 'woof', '... got the right return value for the newly composed method'); + ok($bar->can('talk'), "... the role is now composed at the object level"); -lives_ok { - $foo->dog($bar) -} '... and setting the accessor is okay'; + is($bar->talk, 'woof', '... got the right return value for the newly composed method'); + lives_ok { + $foo->dog($bar) + } '... and setting the accessor is okay'; +} 3; diff --git a/t/030_roles/018_runtime_roles_w_params.t b/t/030_roles/018_runtime_roles_w_params.t index 33de3c3..3a1ba35 100644 --- a/t/030_roles/018_runtime_roles_w_params.t +++ b/t/030_roles/018_runtime_roles_w_params.t @@ -3,9 +3,12 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 21; use Test::Exception; +use MetaTest; { @@ -27,13 +30,15 @@ use Test::Exception; is($foo->bar, 'BAR', '... got the expect value'); ok(!$foo->can('baz'), '... no baz method though'); - lives_ok { - Bar->meta->apply($foo) - } '... this works'; + skip_meta { + lives_ok { + Bar->meta->apply($foo) + } '... this works'; - is($foo->bar, 'BAR', '... got the expect value'); - ok($foo->can('baz'), '... we have baz method now'); - is($foo->baz, 'BAZ', '... got the expect value'); + is($foo->bar, 'BAR', '... got the expect value'); + ok($foo->can('baz'), '... we have baz method now'); + is($foo->baz, 'BAZ', '... got the expect value'); + } 4; } # with extra params ... @@ -44,13 +49,15 @@ use Test::Exception; is($foo->bar, 'BAR', '... got the expect value'); ok(!$foo->can('baz'), '... no baz method though'); - lives_ok { - Bar->meta->apply($foo, (rebless_params => { baz => 'FOO-BAZ' })) - } '... this works'; + skip_meta { + lives_ok { + Bar->meta->apply($foo, (rebless_params => { baz => 'FOO-BAZ' })) + } '... this works'; - is($foo->bar, 'BAR', '... got the expect value'); - ok($foo->can('baz'), '... we have baz method now'); - is($foo->baz, 'FOO-BAZ', '... got the expect value'); + is($foo->bar, 'BAR', '... got the expect value'); + ok($foo->can('baz'), '... we have baz method now'); + is($foo->baz, 'FOO-BAZ', '... got the expect value'); + } 4; } # with extra params ... @@ -61,13 +68,15 @@ use Test::Exception; is($foo->bar, 'BAR', '... got the expect value'); ok(!$foo->can('baz'), '... no baz method though'); - lives_ok { - Bar->meta->apply($foo, (rebless_params => { bar => 'FOO-BAR', baz => 'FOO-BAZ' })) - } '... this works'; + skip_meta { + lives_ok { + Bar->meta->apply($foo, (rebless_params => { bar => 'FOO-BAR', baz => 'FOO-BAZ' })) + } '... this works'; - is($foo->bar, 'FOO-BAR', '... got the expect value'); - ok($foo->can('baz'), '... we have baz method now'); - is($foo->baz, 'FOO-BAZ', '... got the expect value'); + is($foo->bar, 'FOO-BAR', '... got the expect value'); + ok($foo->can('baz'), '... we have baz method now'); + is($foo->baz, 'FOO-BAZ', '... got the expect value'); + } 4; } diff --git a/t/030_roles/019_build.t b/t/030_roles/019_build.t index cd973cd..5154209 100644 --- a/t/030_roles/019_build.t +++ b/t/030_roles/019_build.t @@ -1,13 +1,19 @@ #!/usr/bin/env perl use strict; use warnings; + +use lib 't/lib'; + use Test::More; + BEGIN { eval "use Test::Output;"; plan skip_all => "Test::Output is required for this test" if $@; plan tests => 8; } +use MetaTest; + # this test script ensures that my idiom of: # role: sub BUILD, after BUILD # continues to work to run code after object initialization, whether the class @@ -52,7 +58,8 @@ do { with 'TestRole'; }; -{ +skip_meta { + { is_deeply([splice @CALLS], [], "no calls to BUILD yet"); ClassWithBUILD->new; @@ -76,5 +83,6 @@ do { ClassWithoutBUILD->meta->make_immutable; redo; } -} + } +} 3*2; diff --git a/t/030_roles/020_role_composite.t b/t/030_roles/020_role_composite.t index 9f3b001..5850895 100644 --- a/t/030_roles/020_role_composite.t +++ b/t/030_roles/020_role_composite.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 14; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 14; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/021_role_composite_exclusion.t b/t/030_roles/021_role_composite_exclusion.t index f12cb08..1357e79 100644 --- a/t/030_roles/021_role_composite_exclusion.t +++ b/t/030_roles/021_role_composite_exclusion.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 12; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 12; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/022_role_composition_req_methods.t b/t/030_roles/022_role_composition_req_methods.t index 2e6727e..822d64c 100644 --- a/t/030_roles/022_role_composition_req_methods.t +++ b/t/030_roles/022_role_composition_req_methods.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 16; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 16; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/023_role_composition_attributes.t b/t/030_roles/023_role_composition_attributes.t index 0086435..8237ded 100644 --- a/t/030_roles/023_role_composition_attributes.t +++ b/t/030_roles/023_role_composition_attributes.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 7; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 7; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/024_role_composition_methods.t b/t/030_roles/024_role_composition_methods.t index bf5c517..7d35af2 100644 --- a/t/030_roles/024_role_composition_methods.t +++ b/t/030_roles/024_role_composition_methods.t @@ -3,12 +3,19 @@ use strict; use warnings; -use Test::More tests => 19; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 19; + + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/025_role_composition_override.t b/t/030_roles/025_role_composition_override.t index d47fd3b..24b76ae 100644 --- a/t/030_roles/025_role_composition_override.t +++ b/t/030_roles/025_role_composition_override.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 8; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 8; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/026_role_composition_method_mods.t b/t/030_roles/026_role_composition_method_mods.t index 9de99b4..25d1ee9 100644 --- a/t/030_roles/026_role_composition_method_mods.t +++ b/t/030_roles/026_role_composition_method_mods.t @@ -3,12 +3,18 @@ use strict; use warnings; -use Test::More tests => 7; +use lib 't/lib'; + +use Test::More; use Test::Exception; use Moose::Meta::Role::Application::RoleSummation; use Moose::Meta::Role::Composite; +use MetaTest; + +skip_all_meta 7; + { package Role::Foo; use Moose::Role; diff --git a/t/030_roles/031_roles_applied_in_create.t b/t/030_roles/031_roles_applied_in_create.t index 8aed354..27851ac 100644 --- a/t/030_roles/031_roles_applied_in_create.t +++ b/t/030_roles/031_roles_applied_in_create.t @@ -3,13 +3,16 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More; use Test::Exception; use Moose::Meta::Class; use Moose::Util; use lib 't/lib', 'lib'; +use MetaTest; + +skip_all_meta 1; # Note that this test passed (pre svn #5543) if we inlined the role # definitions in this file, as it was very timing sensitive. diff --git a/t/030_roles/032_roles_and_method_cloning.t b/t/030_roles/032_roles_and_method_cloning.t index 9cd45e0..9f2c4f6 100644 --- a/t/030_roles/032_roles_and_method_cloning.t +++ b/t/030_roles/032_roles_and_method_cloning.t @@ -3,8 +3,11 @@ use strict; use warnings; +use lib 't/lib'; + use Test::More tests => 17; +use MetaTest; { package Role::Foo; @@ -20,7 +23,7 @@ use Test::More tests => 17; with 'Role::Foo'; } -{ +skip_meta { my $meth = ClassA->meta->get_method('foo'); ok( $meth, 'ClassA has a foo method' ); isa_ok( $meth, 'Moose::Meta::Method' ); @@ -30,7 +33,7 @@ use Test::More tests => 17; 'fq name is ClassA::foo' ); is( $meth->original_fully_qualified_name, 'Role::Foo::foo', 'original fq name is Role::Foo::foo' ); -} +} 5; { package Role::Bar; @@ -40,7 +43,7 @@ use Test::More tests => 17; sub bar { } } -{ +skip_meta { my $meth = Role::Bar->meta->get_method('foo'); ok( $meth, 'Role::Bar has a foo method' ); is( $meth->original_method, Role::Foo->meta->get_method('foo'), @@ -49,7 +52,7 @@ use Test::More tests => 17; 'fq name is Role::Bar::foo' ); is( $meth->original_fully_qualified_name, 'Role::Foo::foo', 'original fq name is Role::Foo::foo' ); -} +} 4; { package ClassB; @@ -58,7 +61,7 @@ use Test::More tests => 17; with 'Role::Bar'; } -{ +skip_meta { my $meth = ClassB->meta->get_method('foo'); ok( $meth, 'ClassB has a foo method' ); is( $meth->original_method, Role::Bar->meta->get_method('foo'), @@ -69,7 +72,7 @@ use Test::More tests => 17; 'fq name is ClassA::foo' ); is( $meth->original_fully_qualified_name, 'Role::Foo::foo', 'original fq name is Role::Foo::foo' ); -} +} 5; isnt( ClassA->foo, "ClassB::foo", "ClassA::foo is not confused with ClassB::foo"); diff --git a/t/030_roles/038_new_meta_role.t b/t/030_roles/038_new_meta_role.t index 000fd8e..9e20fba 100644 --- a/t/030_roles/038_new_meta_role.t +++ b/t/030_roles/038_new_meta_role.t @@ -1,7 +1,14 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 1; + +use lib 't/lib'; + +use Test::More; + +use MetaTest; + +skip_all_meta 1; do { package My::Meta::Role; diff --git a/t/030_roles/039_application_toclass.t b/t/030_roles/039_application_toclass.t index 573cec1..badf084 100644 --- a/t/030_roles/039_application_toclass.t +++ b/t/030_roles/039_application_toclass.t @@ -1,7 +1,14 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 24; + +use lib 't/lib'; + +use Test::More; + +use MetaTest; + +skip_all_meta 24; do { package Role::Foo; diff --git a/t/030_roles/040_role_for_combination.t b/t/030_roles/040_role_for_combination.t index 77dc7a2..0a485a2 100644 --- a/t/030_roles/040_role_for_combination.t +++ b/t/030_roles/040_role_for_combination.t @@ -1,7 +1,14 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 3; + +use lib 't/lib'; + +use Test::More; + +use MetaTest; + +skip_all_meta 3; my $OPTS; do { diff --git a/t/030_roles/041_empty_method_modifiers_meta_bug.t b/t/030_roles/041_empty_method_modifiers_meta_bug.t index e7a0f9f..7dfd417 100644 --- a/t/030_roles/041_empty_method_modifiers_meta_bug.t +++ b/t/030_roles/041_empty_method_modifiers_meta_bug.t @@ -2,7 +2,13 @@ use strict; use warnings; -use Test::More tests => 6; +use lib 't/lib'; + +use Test::More; + +use MetaTest; + +skip_all_meta 6; # test role and class package SomeRole;