1use strict; 2use warnings; 3 4use Test::More; 5use Test::Fatal; 6 7use Moose(); 8 9{ 10 my $exception = exception { 11 my $method = Moose::Meta::Method::Constructor->new( options => (1,2,3)); 12 }; 13 14 like( 15 $exception, 16 qr/You must pass a hash of options/, 17 "options is not a HASH ref"); 18 19 isa_ok( 20 $exception, 21 "Moose::Exception::MustPassAHashOfOptions", 22 "options is not a HASH ref"); 23} 24 25{ 26 my $exception = exception { 27 my $method = Moose::Meta::Method::Constructor->new( options => {}); 28 }; 29 30 like( 31 $exception, 32 qr/You must supply the package_name and name parameters/, 33 "package_name and name are not given"); 34 35 isa_ok( 36 $exception, 37 "Moose::Exception::MustSupplyPackageNameAndName", 38 "package_name and name are not given"); 39} 40 41done_testing; 42