X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F050_metaclasses%2F003_moose_w_metaclass.t;h=07490689d1b53d5b9c7a33864d8ef7fc7d7e4e4b;hb=ad3882b59692e4e4eab99f9b183c941e6f63d3bd;hp=55576ba33df929a7c5f7a5aae9d7ab2c39995ae8;hpb=e606ae5f848070d889472329819c95f5ba763ca3;p=gitmo%2FMoose.git diff --git a/t/050_metaclasses/003_moose_w_metaclass.t b/t/050_metaclasses/003_moose_w_metaclass.t index 55576ba..0749068 100644 --- a/t/050_metaclasses/003_moose_w_metaclass.t +++ b/t/050_metaclasses/003_moose_w_metaclass.t @@ -3,18 +3,17 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More; use Test::Exception; - =pod -This test demonstrates that Moose will respect -a metaclass previously set with the metaclass -pragma. +This test demonstrates that Moose will respect +a metaclass previously set with the metaclass +pragma. -It also checks an error condition where that +It also checks an error condition where that metaclass must be a Moose::Meta::Class subclass in order to work. @@ -27,7 +26,7 @@ in order to work. use warnings; use base 'Moose::Meta::Class'; - + package Foo; use strict; use warnings; @@ -41,16 +40,18 @@ isa_ok(Foo->meta, 'Foo::Meta'); package Bar::Meta; use strict; use warnings; - + use base 'Class::MOP::Class'; - + package Bar; use strict; use warnings; use metaclass 'Bar::Meta'; eval 'use Moose;'; ::ok($@, '... could not load moose without correct metaclass'); - ::like($@, + ::like($@, qr/^Bar already has a metaclass, but it does not inherit Moose::Meta::Class/, '... got the right error too'); } + +done_testing;