Deprecate _default_is and _default_default for native traits.
[gitmo/Moose.git] / t / 100_bugs / 024_anon_method_metaclass.t
index ac3eb81..01c5285 100644 (file)
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests => 8;
+use Test::More;
 
 {
     package Ball;
@@ -20,23 +20,24 @@ my $method_meta = Moose::Meta::Class->create_anon_class(
 # For comparing identity without actually keeping $original_meta around
 my $original_meta = "$method_meta";
 
-my $method_class  = $method_meta->name;
+my $method_class = $method_meta->name;
 
 my $method_object = $method_class->wrap(
-    sub { 'ok' },
+    sub {'ok'},
     associated_metaclass => Ball->meta,
     package_name         => 'Ball',
     name                 => 'bounce',
 );
 
-Ball->meta->add_method(bounce => $method_object);
+Ball->meta->add_method( bounce => $method_object );
 
 for ( 1, 2 ) {
     is( Ball->bounce, 'ok', "method still exists on Ball" );
     is( Ball->meta->get_method('bounce')->meta->name, $method_class,
         "method's package still exists" );
 
-    local $TODO = "method seems to be reinitialized" if !$method_meta;
+    is( Ball->meta->get_method('bounce'), $method_object,
+        'original method object is preserved' );
 
     is( Ball->meta->get_method('bounce')->meta . '', $original_meta,
         "method's metaclass still exists" );
@@ -45,3 +46,5 @@ for ( 1, 2 ) {
 
     undef $method_meta;
 }
+
+done_testing;