X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2F022_illegal_options_for_inheritance.t;h=d8066706d3e49633722495b633f93a17e0f8589d;hb=be0ed15704fdad5f2d8517380a6f24687432c1dd;hp=fdf6276f38c0af17804d1c8aeb9c36d4d0061616;hpb=d26c82ab01d405ba41f1c28cdd2f2c8ffa215de1;p=gitmo%2FMoose.git diff --git a/t/020_attributes/022_illegal_options_for_inheritance.t b/t/020_attributes/022_illegal_options_for_inheritance.t index fdf6276..d806670 100644 --- a/t/020_attributes/022_illegal_options_for_inheritance.t +++ b/t/020_attributes/022_illegal_options_for_inheritance.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; { package Foo; @@ -24,12 +24,12 @@ use Test::Exception; extends 'Foo'; - ::lives_ok { has '+foo' => (is => 'rw') } "can override is"; - ::throws_ok { has '+foo' => (reader => 'bar') } qr/illegal/, "can't override reader"; - ::lives_ok { has '+foo' => (clearer => 'baz') } "can override unspecified things"; + ::ok ! ::exception { has '+foo' => (is => 'rw') }, "can override is"; + ::like ::exception { has '+foo' => (reader => 'bar') }, qr/illegal/, "can't override reader"; + ::ok ! ::exception { has '+foo' => (clearer => 'baz') }, "can override unspecified things"; - ::throws_ok { has '+bar' => (clearer => 'quux') } qr/illegal/, "can't override clearer"; - ::lives_ok { has '+bar' => (predicate => 'has_bar') } "can override unspecified things"; + ::like ::exception { has '+bar' => (clearer => 'quux') }, qr/illegal/, "can't override clearer"; + ::ok ! ::exception { has '+bar' => (predicate => 'has_bar') }, "can override unspecified things"; } { @@ -47,13 +47,13 @@ use Test::Exception; package Bar; use Moose; - ::lives_ok { + ::ok ! ::exception { has bar => ( traits => ['Bar::Meta::Attribute'], my_illegal_option => 'FOO', is => 'bare', ); - } "can use illegal options"; + }, "can use illegal options"; has baz => ( traits => ['Bar::Meta::Attribute'], @@ -67,10 +67,10 @@ use Test::Exception; extends 'Bar'; - ::throws_ok { has '+bar' => (my_illegal_option => 'BAR') } + ::like ::exception { has '+bar' => (my_illegal_option => 'BAR') }, qr/illegal/, "can't override illegal attribute"; - ::lives_ok { has '+baz' => (my_illegal_option => 'BAR') } + ::ok ! ::exception { has '+baz' => (my_illegal_option => 'BAR') }, "can add illegal option if superclass doesn't set it"; }