X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F300_basic_safe_mixin.t;h=8311fd58704b79ef1e207c186485bdf1efee86f4;hb=de19f1153a5df8765eae928ea430b7acab545554;hp=06948211081136548c537c19d0ec4acdb989f435;hpb=72c210741ee3aac7aa37579b16e099d5376c62a4;p=gitmo%2FClass-MOP.git diff --git a/t/300_basic_safe_mixin.t b/t/300_basic_safe_mixin.t index 0694821..8311fd5 100644 --- a/t/300_basic_safe_mixin.t +++ b/t/300_basic_safe_mixin.t @@ -13,7 +13,6 @@ BEGIN { ## Mixin a class without a superclass. { package FooMixin; - use metaclass; sub foo { 'FooMixin::foo' } package Foo; @@ -37,6 +36,21 @@ is($foo->foo, 'FooMixin::foo', '... got the right value from the mixin method'); package Bar; our @ISA = ('Foo'); + package Foo::Baz; + our @ISA = ('Foo'); + eval { Foo::Baz->meta->mixin('Baz') }; + ::ok(!$@, '... the classes superclass must extend a subclass of the superclass of the mixins'); + +} + +my $foo_baz = Foo::Baz->new(); +isa_ok($foo_baz, 'Foo::Baz'); +isa_ok($foo_baz, 'Foo'); + +can_ok($foo_baz, 'baz'); +is($foo_baz->baz(), 'Baz::baz', '... got the right value from the mixin method'); + +{ package Foo::Bar; our @ISA = ('Foo', 'Bar');