2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
6 # this functionality may be pushing toward parametric roles/classes
7 # it's off in a corner and may not be that important
13 $TODO = q{Mouse is not yet completed};
28 package My::Metaclass;
30 extends 'Mouse::Meta::Class';
38 $anon = My::Metaclass->create_anon_class( foo => 'this' );
39 } 'create anon class with required attr';
40 isa_ok( $anon, 'My::Metaclass' );
41 cmp_ok( $anon->foo, 'eq', 'this', 'foo is this' );
43 $anon = My::Metaclass->create_anon_class();
44 } 'failed to create anon class without required attr';
49 = My::Metaclass->initialize( 'Class::Name1' => ( foo => 'that' ) );
50 } 'initialize a class with required attr';
51 isa_ok( $meta, 'My::Metaclass' );
52 cmp_ok( $meta->foo, 'eq', 'that', 'foo is that' );
53 cmp_ok( $meta->name, 'eq', 'Class::Name1', 'for the correct class' );
56 = My::Metaclass->initialize( 'Class::Name2' );
57 } 'failed to initialize a class without required attr';
62 use metaclass 'My::Metaclass' => (
68 } 'use metaclass with required attr';
69 $meta = Class::Name3->meta;
70 isa_ok( $meta, 'My::Metaclass' );
71 cmp_ok( $meta->foo, 'eq', 'another', 'foo is another' );
72 cmp_ok( $meta->name, 'eq', 'Class::Name3', 'for the correct class' );
76 use metaclass 'My::Metaclass';
80 } 'failed to use metaclass without required attr';
83 # how do we pass a required attribute to -traits?
87 use Mouse -traits => 'HasFoo';
90 } 'failed to use trait without required attr';