X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F310_inline_structor.t;h=04732d215d3cdc3a879be0bd752244891e71d52d;hb=15961c86cfd845e6f46b6c362cc1a4b94ffb45db;hp=efceb2ff575d90786f0731f9ff38c5ce857a5889;hpb=e24b19fbbf5a62172dad0d8dfb86e03eed9a51c1;p=gitmo%2FClass-MOP.git diff --git a/t/310_inline_structor.t b/t/310_inline_structor.t index efceb2f..04732d2 100644 --- a/t/310_inline_structor.t +++ b/t/310_inline_structor.t @@ -3,11 +3,9 @@ use warnings; use Test::More; -BEGIN { - eval "use Test::Output;"; - plan skip_all => "Test::Output is required for this test" if $@; - plan 'no_plan'; -} +use Test::Requires { + 'Test::Output' => '0.01', # skip all if not installed +}; use Class::MOP; @@ -202,8 +200,7 @@ use Class::MOP; sub _inline_destructor { my $self = shift; - my ( $code, $e ) = $self->_eval_closure( {}, 'sub { }' ); - die $e if $e; + my $code = $self->_compile_code(source => 'sub { }'); $self->{body} = $code; } @@ -293,3 +290,5 @@ use Class::MOP; 'got a warning when trying to inline a destructor in a class that inherits an unexpected DESTROY' ); } + +done_testing;