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=9f834750c03ab1412b4b707dcd5c19df9c538452;hb=805e018dc889a86a74b6a9479b686a1c993d66a1;hp=d8066706d3e49633722495b633f93a17e0f8589d;hpb=be0ed15704fdad5f2d8517380a6f24687432c1dd;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 d806670..9f83475 100644 --- a/t/020_attributes/022_illegal_options_for_inheritance.t +++ b/t/020_attributes/022_illegal_options_for_inheritance.t @@ -24,12 +24,12 @@ use Test::Fatal; extends 'Foo'; - ::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"; + ::is( ::exception { has '+foo' => (is => 'rw') }, undef, "can override is" ); + ::like( ::exception { has '+foo' => (reader => 'bar') }, qr/illegal/, "can't override reader" ); + ::is( ::exception { has '+foo' => (clearer => 'baz') }, undef, "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"; + ::like( ::exception { has '+bar' => (clearer => 'quux') }, qr/illegal/, "can't override clearer" ); + ::is( ::exception { has '+bar' => (predicate => 'has_bar') }, undef, "can override unspecified things" ); } { @@ -47,13 +47,13 @@ use Test::Fatal; package Bar; use Moose; - ::ok ! ::exception { + ::is( ::exception { has bar => ( traits => ['Bar::Meta::Attribute'], my_illegal_option => 'FOO', is => 'bare', ); - }, "can use illegal options"; + }, undef, "can use illegal options" ); has baz => ( traits => ['Bar::Meta::Attribute'], @@ -67,11 +67,8 @@ use Test::Fatal; extends 'Bar'; - ::like ::exception { has '+bar' => (my_illegal_option => 'BAR') }, - qr/illegal/, - "can't override illegal attribute"; - ::ok ! ::exception { has '+baz' => (my_illegal_option => 'BAR') }, - "can add illegal option if superclass doesn't set it"; + ::like( ::exception { has '+bar' => (my_illegal_option => 'BAR') }, qr/illegal/, "can't override illegal attribute" ); + ::is( ::exception { has '+baz' => (my_illegal_option => 'BAR') }, undef, "can add illegal option if superclass doesn't set it" ); } my $bar_attr = Bar->meta->get_attribute('bar');