summaryrefslogtreecommitdiff
path: root/t/exceptions/metaclass.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/exceptions/metaclass.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/exceptions/metaclass.t')
-rw-r--r--t/exceptions/metaclass.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/exceptions/metaclass.t b/t/exceptions/metaclass.t
new file mode 100644
index 0000000..5492df1
--- /dev/null
+++ b/t/exceptions/metaclass.t
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+{
+ {
+ package Foo;
+ use Moose;
+ }
+
+ my $exception = exception {
+ require metaclass;
+ metaclass->import( ("Foo") );
+ };
+
+ like(
+ $exception,
+ qr/\QThe metaclass (Foo) must be derived from Class::MOP::Class/,
+ "Foo is not derived from Class::MOP::Class");
+
+ isa_ok(
+ $exception,
+ "Moose::Exception::MetaclassMustBeDerivedFromClassMOPClass",
+ "Foo is not derived from Class::MOP::Class");
+
+ is(
+ $exception->class_name,
+ 'Foo',
+ "Foo is not derived from Class::MOP::Class");
+}
+
+done_testing;