diff options
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; |