diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-06 17:50:16 +0000 |
commit | 5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch) | |
tree | 298c3d2f08bdfe5689998b11892d72a897985be1 /t/exceptions/rt-94795.t | |
download | Moose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz |
Moose-2.1405HEADMoose-2.1405master
Diffstat (limited to 't/exceptions/rt-94795.t')
-rw-r--r-- | t/exceptions/rt-94795.t | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/t/exceptions/rt-94795.t b/t/exceptions/rt-94795.t new file mode 100644 index 0000000..2742407 --- /dev/null +++ b/t/exceptions/rt-94795.t @@ -0,0 +1,34 @@ +use strict; +use warnings; + +use Test::More; +use Test::Fatal; + +# https://rt.cpan.org/Ticket/Display.html?id=94795 + +# the exception produced should be AttributeIsRequired, however +# AttributeIsRequired was throwing the exception ClassNamesDoNotMatch. + +{ + package AAA; + use Moose; + has my_attr => ( + is => 'ro', + required => 1, + ); +} + +{ + package BBB; + use Moose; + extends qw/AAA/; +} + +my $e = exception { BBB->new }; +ok( + $e->isa('Moose::Exception::AttributeIsRequired'), + 'got the right exception', +) +or note 'got exception ', ref($e), ': ', $e->message; + +done_testing; |