X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F32_next_method_edge_cases.t;h=94e79bf57d00be4feab68537f201ea1dd052e814;hb=08c2921109d622fd3a1052bf291c246b90fde1a9;hp=0e5e913552b571efffb4ef068bce5872677ce664;hpb=bad9dc5953e918bfb388c7a7f430493a3e44a8d0;p=gitmo%2FClass-C3.git diff --git a/t/32_next_method_edge_cases.t b/t/32_next_method_edge_cases.t index 0e5e913..94e79bf 100644 --- a/t/32_next_method_edge_cases.t +++ b/t/32_next_method_edge_cases.t @@ -9,8 +9,6 @@ BEGIN { use_ok('Class::C3'); } -use Sub::Name; - { { @@ -40,19 +38,24 @@ use Sub::Name; our @ISA = ('Foo'); } - my $m = sub { (shift)->next::method() }; - subname('Bar::bar', $m); - { - no strict 'refs'; - *{'Bar::bar'} = $m; - } - my $bar = Bar->new(); isa_ok($bar, 'Bar'); - isa_ok($bar, 'Foo'); - - can_ok($bar, 'bar'); - my $value = eval { $bar->bar() }; - ok(!$@, '... calling bar() succedded') || diag $@; - is($value, 'Foo::bar', '... got the right return value too'); + isa_ok($bar, 'Foo'); + + SKIP: { + eval 'use Sub::Name'; + skip "Sub::Name is required for this test", 3 if $@; + + my $m = sub { (shift)->next::method() }; + Sub::Name::subname('Bar::bar', $m); + { + no strict 'refs'; + *{'Bar::bar'} = $m; + } + + can_ok($bar, 'bar'); + my $value = eval { $bar->bar() }; + ok(!$@, '... calling bar() succedded') || diag $@; + is($value, 'Foo::bar', '... got the right return value too'); + } } \ No newline at end of file