1use strict; 2use warnings; 3 4use Test::More; 5use Test::Fatal; 6 7use Class::MOP; 8 9{ 10 my $exception = exception { 11 Class::MOP::Mixin->_throw_exception(Legacy => message => 'oh hai'); 12 }; 13 ok( 14 $exception->isa('Moose::Exception::Legacy'), 15 'threw the right type', 16 ); 17 is($exception->message, 'oh hai', 'got the message attribute'); 18} 19 20done_testing; 21