Redid conversion to Test::Fatal
[gitmo/Moose.git] / t / 020_attributes / 009_attribute_inherited_slot_specs.t
index 2e089cb..ef0f3d9 100644 (file)
@@ -59,138 +59,138 @@ use Test::Fatal;
 
     extends 'Foo';
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+bar' => (default => 'Bar::bar');
-    }, '... we can change the default attribute option';
+    }, undef, '... we can change the default attribute option' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+baz' => (isa => 'ArrayRef');
-    }, '... we can add change the isa as long as it is a subtype';
+    }, undef, '... we can add change the isa as long as it is a subtype' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+foo' => (coerce => 1);
-    }, '... we can change/add coerce as an attribute option';
+    }, undef, '... we can change/add coerce as an attribute option' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+gorch' => (required => 1);
-    }, '... we can change/add required as an attribute option';
+    }, undef, '... we can change/add required as an attribute option' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+gloum' => (lazy => 1);
-    }, '... we can change/add lazy as an attribute option';
+    }, undef, '... we can change/add lazy as an attribute option' );
 
-    ::ok ! ::exception {
-        has '+gloum' => (lazy_build => 1);
-    }, '... we can add lazy_build as an attribute option';
+    ::is( ::exception {
+        has '+fleem' => (lazy_build => 1);
+    }, undef, '... we can add lazy_build as an attribute option' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+bunch_of_stuff' => (isa => 'ArrayRef[Int]');
-    }, '... extend an attribute with parameterized type';
+    }, undef, '... extend an attribute with parameterized type' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+one_last_one' => (isa => subtype('Ref', where { blessed $_ eq 'CODE' }));
-    }, '... extend an attribute with anon-subtype';
+    }, undef, '... extend an attribute with anon-subtype' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+one_last_one' => (isa => 'Value');
-    }, '... now can extend an attribute with a non-subtype';
+    }, undef, '... now can extend an attribute with a non-subtype' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+fleem' => (weak_ref => 1);
-    }, '... now allowed to add the weak_ref option via inheritance';
+    }, undef, '... now allowed to add the weak_ref option via inheritance' );
 
-    ::ok ! ::exception {
+    ::is( ::exception {
         has '+bling' => (handles => ['hello']);
-    }, '... we can add the handles attribute option';
+    }, undef, '... we can add the handles attribute option' );
 
     # this one will *not* work here ....
-    ::ok ::exception {
+    ::isnt( ::exception {
         has '+blang' => (handles => ['hello']);
-    }, '... we can not alter the handles attribute option';
-    ::ok ! ::exception {
+    }, undef, '... we can not alter the handles attribute option' );
+    ::is( ::exception {
         has '+fail' => (isa => 'Ref');
-    }, '... can now create an attribute with an improper subtype relation';
-    ::ok ::exception {
+    }, undef, '... can now create an attribute with an improper subtype relation' );
+    ::isnt( ::exception {
         has '+other_fail' => (trigger => sub {});
-    }, '... cannot create an attribute with an illegal option';
-    ::like ::exception {
+    }, undef, '... cannot create an attribute with an illegal option' );
+    ::like( ::exception {
         has '+does_not_exist' => (isa => 'Str');
-    }, qr/in Bar/, '... cannot extend a non-existing attribute';
+    }, qr/in Bar/, '... cannot extend a non-existing attribute' );
 }
 
 my $foo = Foo->new;
 isa_ok($foo, 'Foo');
 
 is($foo->foo, undef, '... got the right undef default value');
-ok ! exception { $foo->foo('FooString') }, '... assigned foo correctly';
+is( exception { $foo->foo('FooString') }, undef, '... assigned foo correctly' );
 is($foo->foo, 'FooString', '... got the right value for foo');
 
-ok exception { $foo->foo([]) }, '... foo is not coercing (as expected)';
+isnt( exception { $foo->foo([]) }, undef, '... foo is not coercing (as expected)' );
 
 is($foo->bar, 'Foo::bar', '... got the right default value');
-ok exception { $foo->bar(10) }, '... Foo::bar is a read/only attr';
+isnt( exception { $foo->bar(10) }, undef, '... Foo::bar is a read/only attr' );
 
 is($foo->baz, undef, '... got the right undef default value');
 
 {
     my $hash_ref = {};
-    ok ! exception { $foo->baz($hash_ref) }, '... Foo::baz accepts hash refs';
+    is( exception { $foo->baz($hash_ref) }, undef, '... Foo::baz accepts hash refs' );
     is($foo->baz, $hash_ref, '... got the right value assigned to baz');
 
     my $array_ref = [];
-    ok ! exception { $foo->baz($array_ref) }, '... Foo::baz accepts an array ref';
+    is( exception { $foo->baz($array_ref) }, undef, '... Foo::baz accepts an array ref' );
     is($foo->baz, $array_ref, '... got the right value assigned to baz');
 
     my $scalar_ref = \(my $var);
-    ok ! exception { $foo->baz($scalar_ref) }, '... Foo::baz accepts scalar ref';
+    is( exception { $foo->baz($scalar_ref) }, undef, '... Foo::baz accepts scalar ref' );
     is($foo->baz, $scalar_ref, '... got the right value assigned to baz');
 
-    ok ! exception { $foo->bunch_of_stuff([qw[one two three]]) }, '... Foo::bunch_of_stuff accepts an array of strings';
+    is( exception { $foo->bunch_of_stuff([qw[one two three]]) }, undef, '... Foo::bunch_of_stuff accepts an array of strings' );
 
-    ok ! exception { $foo->one_last_one(sub { 'Hello World'}) }, '... Foo::one_last_one accepts a code ref';
+    is( exception { $foo->one_last_one(sub { 'Hello World'}) }, undef, '... Foo::one_last_one accepts a code ref' );
 
     my $code_ref = sub { 1 };
-    ok ! exception { $foo->baz($code_ref) }, '... Foo::baz accepts a code ref';
+    is( exception { $foo->baz($code_ref) }, undef, '... Foo::baz accepts a code ref' );
     is($foo->baz, $code_ref, '... got the right value assigned to baz');
 }
 
-ok exception {
+isnt( exception {
     Bar->new;
-}, '... cannot create Bar without required gorch param';
+}, undef, '... cannot create Bar without required gorch param' );
 
 my $bar = Bar->new(gorch => 'Bar::gorch');
 isa_ok($bar, 'Bar');
 isa_ok($bar, 'Foo');
 
 is($bar->foo, undef, '... got the right undef default value');
-ok ! exception { $bar->foo('FooString') }, '... assigned foo correctly';
+is( exception { $bar->foo('FooString') }, undef, '... assigned foo correctly' );
 is($bar->foo, 'FooString', '... got the right value for foo');
-ok ! exception { $bar->foo([]) }, '... assigned foo correctly';
+is( exception { $bar->foo([]) }, undef, '... assigned foo correctly' );
 is($bar->foo, 'FooArrayRef', '... got the right value for foo');
 
 is($bar->gorch, 'Bar::gorch', '... got the right default value');
 
 is($bar->bar, 'Bar::bar', '... got the right default value');
-ok exception { $bar->bar(10) }, '... Bar::bar is a read/only attr';
+isnt( exception { $bar->bar(10) }, undef, '... Bar::bar is a read/only attr' );
 
 is($bar->baz, undef, '... got the right undef default value');
 
 {
     my $hash_ref = {};
-    ok exception { $bar->baz($hash_ref) }, '... Bar::baz does not accept hash refs';
+    isnt( exception { $bar->baz($hash_ref) }, undef, '... Bar::baz does not accept hash refs' );
 
     my $array_ref = [];
-    ok ! exception { $bar->baz($array_ref) }, '... Bar::baz can accept an array ref';
+    is( exception { $bar->baz($array_ref) }, undef, '... Bar::baz can accept an array ref' );
     is($bar->baz, $array_ref, '... got the right value assigned to baz');
 
     my $scalar_ref = \(my $var);
-    ok exception { $bar->baz($scalar_ref) }, '... Bar::baz does not accept a scalar ref';
+    isnt( exception { $bar->baz($scalar_ref) }, undef, '... Bar::baz does not accept a scalar ref' );
 
-    ok ! exception { $bar->bunch_of_stuff([1, 2, 3]) }, '... Bar::bunch_of_stuff accepts an array of ints';
-    ok exception { $bar->bunch_of_stuff([qw[one two three]]) }, '... Bar::bunch_of_stuff does not accept an array of strings';
+    is( exception { $bar->bunch_of_stuff([1, 2, 3]) }, undef, '... Bar::bunch_of_stuff accepts an array of ints' );
+    isnt( exception { $bar->bunch_of_stuff([qw[one two three]]) }, undef, '... Bar::bunch_of_stuff does not accept an array of strings' );
 
     my $code_ref = sub { 1 };
-    ok exception { $bar->baz($code_ref) }, '... Bar::baz does not accept a code ref';
+    isnt( exception { $bar->baz($code_ref) }, undef, '... Bar::baz does not accept a code ref' );
 }
 
 # check some meta-stuff