6 use Test::More tests => 16;
12 ## Mixin a class without a superclass.
17 sub foo { 'FooMixin::foo' }
24 sub new { (shift)->meta->new_object(@_) }
31 is($foo->foo, 'FooMixin::foo', '... got the right value from the mixin method');
33 ## Mixin a class who shares a common ancestor
39 sub baz { 'Baz::baz' }
49 ::ok(!$@, '... the classes superclass must extend a subclass of the superclass of the mixins');
53 my $foo_baz = Foo::Baz->new();
54 isa_ok($foo_baz, 'Foo::Baz');
55 isa_ok($foo_baz, 'Foo');
57 can_ok($foo_baz, 'baz');
58 is($foo_baz->baz(), 'Baz::baz', '... got the right value from the mixin method');
65 package Foo::Bar::Baz;
69 ::ok(!$@, '... the classes superclass must extend a subclass of the superclass of the mixins');
72 my $foo_bar_baz = Foo::Bar::Baz->new();
73 isa_ok($foo_bar_baz, 'Foo::Bar::Baz');
74 isa_ok($foo_bar_baz, 'Foo::Bar');
75 isa_ok($foo_bar_baz, 'Foo');
76 isa_ok($foo_bar_baz, 'Bar');
78 can_ok($foo_bar_baz, 'baz');
79 is($foo_bar_baz->baz(), 'Baz::baz', '... got the right value from the mixin method');