9 plan skip_all => "Moose 0.68 required for this test" unless eval { require Moose && Moose->VERSION('0.68') };
27 ::lives_ok { extends qw(Foo) } "extend Mouse class with Moose";
34 } "new attr in subclass";
39 ::lives_ok { extends qw(Foo) } "extend Mouse class with Moose";
42 local our $TODO = "Moose not yet aware of Mouse meta";
47 } "clone and inherit attr in subclass";
61 ::lives_ok { extends qw(Quxx) } "extend Mouse class with Moose";
69 can_ok( Bar => "new" );
71 my $bar = eval { Bar->new };
73 ok( $bar, "got an object" );
74 isa_ok( $bar, "Bar" );
75 isa_ok( $bar, "Foo" );
77 can_ok( $bar, qw(foo bar) );
79 is( eval { $bar->foo }, undef, "no default value" );
80 is( eval { $bar->bar }, undef, "no default value" );
83 local $TODO = "Moose not yet aware of Mouse meta";
87 [ sort map { $_->name } Bar->meta->get_all_attributes ],
92 is( eval { Gorch->new->foo }, 3, "cloned and inherited attr's default" );
95 can_ok( Zork => "new" );
98 my $zork = eval { Zork->new };
100 ok( $zork, "got an object" );
101 isa_ok( $zork, "Zork" );
102 isa_ok( $zork, "Quxx" );
104 can_ok( $zork, qw(quxx zork) );
106 local $TODO = "Constructor needs to know default values of attrs from both";
107 is( eval { $bar->quxx }, "lala", "default value" );
108 is( eval { $bar->zork }, 42, "default value" );
112 my $zork = eval { Zork->new( zork => "diff", quxx => "blah" ) };
114 ok( $zork, "got an object" );
115 isa_ok( $zork, "Zork" );
116 isa_ok( $zork, "Quxx" );
118 can_ok( $zork, qw(quxx zork) );
120 local $TODO = "Constructor needs to know init args of attrs from both";
121 is( eval { $bar->quxx }, "blah", "constructor param" );
122 is( eval { $bar->zork }, "diff", "constructor param" );