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.
use warnings;
use base 'Moose::Meta::Class';
-
+
package Foo;
use strict;
use warnings;
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($@,
- qr/^You already have a \&meta function\, but it does not return a Moose\:\:Meta\:\:Class/,
+ ::like($@,
+ qr/^Bar already has a metaclass, but it does not inherit Moose::Meta::Class/,
'... got the right error too');
}
+
+done_testing;