Actually implemented public get_method_map for back-compat, and made sure all its...
[gitmo/Class-MOP.git] / t / 500_deprecated.t
index 165219e..2914ecc 100755 (executable)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More tests => 6;
 use Test::Exception;
 
 use Carp;
@@ -53,3 +53,24 @@ $SIG{__WARN__} = \&croak;
     } 'safe in an inner class';
 }
 
+{
+    package Quux;
+
+    use Class::MOP::Deprecated -compatible => 0.92;
+    use Scalar::Util qw( blessed );
+
+    use metaclass;
+
+    sub foo {42}
+
+    Quux->meta->add_method( bar => sub {84} );
+
+    my $map = Quux->meta->get_method_map;
+    my @method_objects = grep { blessed($_) } values %{$map};
+
+    ::is( scalar @method_objects, 3,
+          'get_method_map still returns all values as method object' );
+    ::is_deeply( [ sort keys %{$map} ],
+                 [ qw( bar foo meta ) ],
+                 'get_method_map returns expected methods' );
+}