Merge branch 'stable'
[gitmo/Class-MOP.git] / t / 310_inline_structor.t
index 8e1b055..27024ce 100644 (file)
@@ -3,10 +3,9 @@ use warnings;
 
 use Test::More;
 
-BEGIN {
-    eval "use Test::Output;";
-    plan skip_all => "Test::Output is required for this test" if $@;
-}
+use Test::Requires {
+    'Test::Output' => '0.01', # skip all if not installed
+};
 
 use Class::MOP;
 
@@ -201,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('sub { }');
 
         $self->{body} = $code;
     }