Ignore methods from UNIVERSAL in test
Dave Rolsky [Sat, 17 Sep 2011 02:15:11 +0000 (21:15 -0500)]
t/cmop/advanced_methods.t

index dbc681b..edfb3c3 100644 (file)
@@ -69,7 +69,11 @@ is(Class::MOP::Class->initialize('Foo::Bar::Baz')->find_next_method_by_name('BUI
    '... Foo::Bar::Baz->BUILD does have a next method');
 
 is_deeply(
-    [ sort { $a->name cmp $b->name } Class::MOP::Class->initialize('Foo')->get_all_methods() ],
+    [
+        sort { $a->name cmp $b->name }
+            grep { $_->package_name ne 'UNIVERSAL' }
+            Class::MOP::Class->initialize('Foo')->get_all_methods()
+    ],
     [
         Class::MOP::Class->initialize('Foo')->get_method('BUILD') ,
         Class::MOP::Class->initialize('Foo')->get_method('foo'),
@@ -77,7 +81,11 @@ is_deeply(
     '... got the right list of applicable methods for Foo');
 
 is_deeply(
-    [ sort { $a->name cmp $b->name } Class::MOP::Class->initialize('Bar')->get_all_methods() ],
+    [
+        sort { $a->name cmp $b->name }
+            grep { $_->package_name ne 'UNIVERSAL' }
+            Class::MOP::Class->initialize('Bar')->get_all_methods()
+    ],
     [
         Class::MOP::Class->initialize('Bar')->get_method('BUILD'),
         Class::MOP::Class->initialize('Bar')->get_method('bar'),
@@ -87,7 +95,11 @@ is_deeply(
 
 
 is_deeply(
-    [ sort { $a->name cmp $b->name } Class::MOP::Class->initialize('Baz')->get_all_methods() ],
+    [
+        sort { $a->name cmp $b->name }
+            grep { $_->package_name ne 'UNIVERSAL' }
+            Class::MOP::Class->initialize('Baz')->get_all_methods()
+    ],
     [
         Class::MOP::Class->initialize('Bar')->get_method('BUILD'),
         Class::MOP::Class->initialize('Bar')->get_method('bar'),
@@ -97,7 +109,11 @@ is_deeply(
     '... got the right list of applicable methods for Baz');
 
 is_deeply(
-    [ sort { $a->name cmp $b->name } Class::MOP::Class->initialize('Foo::Bar')->get_all_methods() ],
+    [
+        sort { $a->name cmp $b->name }
+            grep { $_->package_name ne 'UNIVERSAL' }
+            Class::MOP::Class->initialize('Foo::Bar')->get_all_methods()
+    ],
     [
         Class::MOP::Class->initialize('Foo::Bar')->get_method('BUILD'),
         Class::MOP::Class->initialize('Bar')->get_method('bar'),