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=40b11c7069fe3f526eeec3a0b1ec1ad89ace4fcf;hp=a2129e9a2874f4d05ccccadf0f094d4ff05b8f0a;hb=f85a85b0ba6ea4eca7346b4bb0d7b3ce960b8e92;hpb=21f40c746495a35d2326c5ddae209b6b883ed46b diff --git a/t/load_plugins.t b/t/load_plugins.t old mode 100755 new mode 100644 index a2129e9..40b11c7 --- a/t/load_plugins.t +++ b/t/load_plugins.t @@ -1,7 +1,9 @@ + use strict; use warnings; use Test::More; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use_ok('Devel::REPL'); @@ -37,24 +39,29 @@ Timing 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 +# 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 +# Term::ReadLine::Perl works." -- RT#84246 +my $repl = Devel::REPL->new; for my $plugin_name (@plugins) { test_load_plugin($plugin_name); } sub test_load_plugin { my ($plugin_name) = @_; - my $repl = Devel::REPL->new; 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) + or diag $@; } } done_testing; -