X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=t%2Fload_plugins.t;h=e7d165596791911b7bbe5488e1ae8a664b3aa801;hp=d3ff2e3f049f04fce382fe389adcd27eca802038;hb=85161343027e915efe3db3e09a54902e8afc831a;hpb=d6d183430fa16815ee449fb2792152636d7cfba8 diff --git a/t/load_plugins.t b/t/load_plugins.t index d3ff2e3..e7d1655 100755 --- a/t/load_plugins.t +++ b/t/load_plugins.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::More; -use Test::Warnings; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use_ok('Devel::REPL'); @@ -41,7 +41,7 @@ Turtles # one $repl is shared: # "Looks like the problem is that you can't open multiple instances of -# Term::ReadLine:PERL from the same object. I was able to correct this by +# Term::ReadLine:Perl from the same object. I was able to correct this by # changing the test to reuse the same Devel::REPL instance each time. This # prevents the warning that causes the test to fail. I don't think this # changes the spirit of the test, it's just a byproduct of how @@ -54,16 +54,13 @@ for my $plugin_name (@plugins) { sub test_load_plugin { my ($plugin_name) = @_; my $test_name = "plugin $plugin_name loaded"; - eval "use Devel::REPL::Plugin::$plugin_name"; - unless($@) { - eval { $repl->load_plugin($plugin_name) }; - ok(!$@, $test_name); - } else { - SKIP: { - skip "could not eval plugin $plugin_name", 1; - } + + SKIP: { + eval "use Devel::REPL::Plugin::$plugin_name; 1" + or skip "could not eval plugin $plugin_name", 1; + + ok(eval { $repl->load_plugin($plugin_name); 1 }, $test_name); } } done_testing; -