X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F300_immutable%2F007_immutable_trigger_from_constructor.t;h=037a1e53aa0afa89272fd472c308c54af1cd54e6;hb=51c788414482c813eb48fb417b08ba03134ff1a6;hp=cab557ff8c748abea46bc377926dd94492e1e8ee;hpb=7ff5653479c2bfc0794635f7fbade9bfe7bb2381;p=gitmo%2FMoose.git diff --git a/t/300_immutable/007_immutable_trigger_from_constructor.t b/t/300_immutable/007_immutable_trigger_from_constructor.t index cab557f..037a1e5 100644 --- a/t/300_immutable/007_immutable_trigger_from_constructor.t +++ b/t/300_immutable/007_immutable_trigger_from_constructor.t @@ -3,9 +3,8 @@ use strict; use warnings; -use Test::More tests => 3; -use Test::Exception; - +use Test::More; +use Test::Fatal; { @@ -16,12 +15,12 @@ use Test::Exception; has 'foo' => (is => 'rw', isa => 'Maybe[Str]', trigger => sub { die "Pulling the Foo trigger\n" }); - - has 'bar' => (is => 'rw', isa => 'Maybe[Str]'); - + + has 'bar' => (is => 'rw', isa => 'Maybe[Str]'); + has 'baz' => (is => 'rw', isa => 'Maybe[Str]', trigger => sub { die "Pulling the Baz trigger\n" - }); + }); __PACKAGE__->meta->make_immutable; #(debug => 1); @@ -34,7 +33,6 @@ like ($@, qr/^Pulling the Foo trigger/, "trigger from immutable constructor"); eval { AClass->new(baz => 'bar') }; like ($@, qr/^Pulling the Baz trigger/, "trigger from immutable constructor"); -lives_ok { AClass->new(bar => 'bar') } '... no triggers called'; - - +is( exception { AClass->new(bar => 'bar') }, undef, '... no triggers called' ); +done_testing;