Merge branch 'stable'
[gitmo/Class-MOP.git] / t / 310_inline_structor.t
index bbdcce8..27024ce 100644 (file)
@@ -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,13 +200,14 @@ use Class::MOP;
     sub _inline_destructor {
         my $self = shift;
 
-        my $code = $self->_eval_closure( {}, 'sub { }' );
+        my $code = $self->_compile_code('sub { }');
 
         $self->{body} = $code;
     }
 
     sub is_needed { 1 }
     sub associated_metaclass { $_[0]->{metaclass} }
+    sub body { $_[0]->{body} }
     sub _expected_method_class { 'Base::Class' }
 }
 
@@ -291,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;