Add another MOOSE_TEST_MD option, MooseX
[gitmo/Moose.git] / t / roles / apply_role.t
index 1c2c38e..2f8d07f 100644 (file)
@@ -63,6 +63,11 @@ use Test::Fatal;
     with 'FooRole', 'BarRole';
 }
 
+{
+    package PlainJane;
+    sub new { return bless {}, __PACKAGE__; }
+}
+
 my $foo_class_meta = FooClass->meta;
 isa_ok( $foo_class_meta, 'Moose::Meta::Class' );
 
@@ -212,4 +217,13 @@ foreach my $foo ( $foo, $foobar ) {
     }
 }
 
+{
+    ok(!Moose::Util::find_meta('PlainJane'), 'not initialized');
+    Moose::Util::apply_all_roles('PlainJane', 'BarRole');
+    ok(Moose::Util::find_meta('PlainJane'), 'initialized');
+    ok(Moose::Util::find_meta('PlainJane')->does_role('BarRole'), 'does BarRole');
+    my $pj = PlainJane->new();
+    ok($pj->can('woot'), 'can woot');
+}
+
 done_testing;