From: Peter Rabbitson Date: Sat, 12 Sep 2009 11:03:44 +0000 (+0000) Subject: use Test::Exception X-Git-Tag: v1.001000~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f93fa530afe98b6faff15b9e48e404a5888f1a3d;p=p5sagit%2FClass-C3-Componentised.git use Test::Exception --- diff --git a/t/01-basic.t b/t/01-basic.t index f655db8..12cad2f 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -48,9 +48,11 @@ ok( !$retval, 'nonexistent package not loaded' ); $retval = eval { MyModule->load_optional_class('MyModule::OwnComponent') }; ok( !$@, 'load_optional_class on an existing class did not throw' ); ok( $retval, 'MyModule::OwnComponent loaded' ); -eval { MyModule->load_optional_class('MyModule::ErrorComponent') }; -like( $@, qr/did not return a true value/, - 'MyModule::ErrorComponent threw ok' ); +throws_ok ( + sub { MyModule->load_optional_class('MyModule::ErrorComponent') }, + qr/did not return a true value/, + 'MyModule::ErrorComponent threw ok' +); # Simulate a PAR environment {