summaryrefslogtreecommitdiff
path: root/t/exceptions/rt-92818.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/rt-92818.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/exceptions/rt-92818.t')
-rw-r--r--t/exceptions/rt-92818.t45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/exceptions/rt-92818.t b/t/exceptions/rt-92818.t
new file mode 100644
index 0000000..b504841
--- /dev/null
+++ b/t/exceptions/rt-92818.t
@@ -0,0 +1,45 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+# https://rt.cpan.org/Ticket/Display.html?id=92818
+
+{
+ package Parent;
+ use Moose;
+ has x => (
+ is => 'rw',
+ required => 1,
+ );
+}
+
+{
+ my $e = exception { my $obj = Parent->new };
+ ok(
+ $e->isa('Moose::Exception::AttributeIsRequired'),
+ 'got the right exception',
+ )
+ or note 'got exception ', ref($e), ': ', $e->message;
+}
+
+{
+ package Child;
+ use Moose;
+ extends 'Parent';
+}
+
+# the exception produced should be AttributeIsRequired, however
+# AttributeIsRequired was throwing the exception ClassNamesDoNotMatch.
+
+{
+ my $e = exception { my $obj = Child->new };
+ ok(
+ $e->isa('Moose::Exception::AttributeIsRequired'),
+ 'got the right exception',
+ )
+ or note 'got exception ', ref($e), ': ', $e->message;
+}
+
+done_testing;