diff options
-rw-r--r-- | t/base2.t | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -3,16 +3,15 @@ use strict; use warnings; use lib 't/base2'; use Test::More; -use Test::Exception; -# Test passes if you comment this out no circular::require; use_ok('Foo'); -lives_ok { is( Foo->bar, "bar", "Polymorphism" ) } - "bar() method available on Foo"; +is(Foo->bar, "bar", "Polymorphism"); -throws_ok { base->import( 'BadWolf' ) } - qr|Base class package "BadWolf" is empty|, "use base 'Some Bad File' should throw an exception"; +my $ok = eval "use base 'BadWolf'"; +my $err = $@; +ok(!$ok, "use base 'Some Bad File' should throw an exception"); +like($err, qr/Base class package "BadWolf" is empty/, "correct exception"); done_testing; |