getting this up to speed with Class::MOP 0.35
[gitmo/Moose.git] / t / 041_role.t
index 2c312eb..875db47 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 35;
 use Test::Exception;
 
 BEGIN {  
@@ -20,8 +20,6 @@ words, should 'has_method' return true for them?
 
 =cut
 
-=begin nonsense
-
 {
     package FooRole;
     use Moose::Role;
@@ -51,8 +49,7 @@ words, should 'has_method' return true for them?
 
 my $foo_role = FooRole->meta;
 isa_ok($foo_role, 'Moose::Meta::Role');
-
-isa_ok($foo_role->_role_meta, 'Class::MOP::Class');
+isa_ok($foo_role, 'Class::MOP::Module');
 
 is($foo_role->name, 'FooRole', '... got the right name of FooRole');
 is($foo_role->version, '0.01', '... got the right version of FooRole');
@@ -60,12 +57,12 @@ is($foo_role->version, '0.01', '... got the right version of FooRole');
 # methods ...
 
 ok($foo_role->has_method('foo'), '... FooRole has the foo method');
-is($foo_role->get_method('foo'), \&FooRole::foo, '... FooRole got the foo method');
+is($foo_role->get_method('foo')->body, \&FooRole::foo, '... FooRole got the foo method');
 
 isa_ok($foo_role->get_method('foo'), 'Moose::Meta::Role::Method');
 
 ok($foo_role->has_method('boo'), '... FooRole has the boo method');
-is($foo_role->get_method('boo'), \&FooRole::boo, '... FooRole got the boo method');
+is($foo_role->get_method('boo')->body, \&FooRole::boo, '... FooRole got the boo method');
 
 isa_ok($foo_role->get_method('boo'), 'Moose::Meta::Role::Method');
 
@@ -147,4 +144,3 @@ is_deeply(
     [ 'bling', 'fling' ],
     '... got the right list of override method modifiers');
 
-=cut