X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F500_deprecated.t;h=2914ecce2b6e2a555fbc4a989a1be2265ba90b61;hb=b409c96967194909d2071df0e129453d1b7f74d7;hp=165219e33c5a4766cc8bf4496c0c594564aa5c32;hpb=bcef1f7ccd2532332b64ec22c44b202395733411;p=gitmo%2FClass-MOP.git diff --git a/t/500_deprecated.t b/t/500_deprecated.t index 165219e..2914ecc 100755 --- a/t/500_deprecated.t +++ b/t/500_deprecated.t @@ -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' ); +}