Redid conversion to Test::Fatal
[gitmo/Moose.git] / t / 200_examples / 003_example.t
index 1745839..c3f5a68 100644 (file)
@@ -3,8 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 30;
-use Test::Exception;
+use Test::More;
+use Test::Fatal;
 
 sub U {
     my $f = shift;
@@ -30,7 +30,7 @@ sub Y {
     sub head { (shift)->_list->[0] }
     sub tail {
         my $self = shift;
-        $self->new(
+        (ref $self)->new(
             '::' => [
                 @{$self->_list}[1 .. $#{$self->_list}]
             ]
@@ -67,7 +67,7 @@ sub Y {
             my $redo = shift;
             sub {
                 my ($list, $func, $acc) = @_;
-                return $list->new('::' => $acc)
+                return (ref $list)->new('::' => $acc)
                     if $list->is_empty;
                 $redo->(
                     $list->tail,
@@ -81,16 +81,16 @@ sub Y {
     package My::List1;
     use Moose;
 
-    ::lives_ok {
+    ::is( ::exception {
         with 'List', 'List::Immutable';
-    } '... successfully composed roles together';
+    }, undef, '... successfully composed roles together' );
 
     package My::List2;
     use Moose;
 
-    ::lives_ok {
+    ::is( ::exception {
         with 'List::Immutable', 'List';
-    } '... successfully composed roles together';
+    }, undef, '... successfully composed roles together' );
 
 }
 
@@ -154,10 +154,4 @@ sub Y {
     is($coll2->print, '1, 4, 9, 16, 25, 36, 49, 64, 81, 100', '... new collection is changed');
 }
 
-
-
-
-
-
-
-
+done_testing;