X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F034_duck_types.t;h=cc128522819686e9ffe615c719deeec174cbc566;hb=51c788414482c813eb48fb417b08ba03134ff1a6;hp=5682793478990f03e8b652ee161b2889a86a3799;hpb=a28e50e44945358d15eb19e4688573741a319fe0;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/034_duck_types.t b/t/040_type_constraints/034_duck_types.t index 5682793..cc12852 100644 --- a/t/040_type_constraints/034_duck_types.t +++ b/t/040_type_constraints/034_duck_types.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; { @@ -62,21 +62,18 @@ use Test::Exception; } # try giving it a duck -lives_ok { DucktypeTest->new( duck => Duck->new ) } 'the Duck lives okay'; +is( exception { DucktypeTest->new( duck => Duck->new ) }, undef, 'the Duck lives okay' ); # try giving it a swan which is like a duck, but not close enough -throws_ok { DucktypeTest->new( duck => Swan->new ) } -qr/Swan is missing methods 'quack'/, - "the Swan doesn't quack"; +like( exception { DucktypeTest->new( duck => Swan->new ) }, qr/Swan is missing methods 'quack'/, "the Swan doesn't quack" ); # try giving it a rubber RubberDuckey -lives_ok { DucktypeTest->new( swan => Swan->new ) } 'but a Swan can honk'; +is( exception { DucktypeTest->new( swan => Swan->new ) }, undef, 'but a Swan can honk' ); # try giving it a rubber RubberDuckey -lives_ok { DucktypeTest->new( duck => RubberDuck->new ) } -'the RubberDuck lives okay'; +is( exception { DucktypeTest->new( duck => RubberDuck->new ) }, undef, 'the RubberDuck lives okay' ); # try with the other constraint form -lives_ok { DucktypeTest->new( other_swan => Swan->new ) } 'but a Swan can honk'; +is( exception { DucktypeTest->new( other_swan => Swan->new ) }, undef, 'but a Swan can honk' ); done_testing;