From: Zakariyya Mughal Date: Sun, 17 Mar 2013 22:27:46 +0000 (-0500) Subject: test plugin loading X-Git-Tag: v1.003016~6^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1680cce5b6c1c8d30dba643079fccb4c1833acaf;p=p5sagit%2FDevel-REPL.git test plugin loading --- diff --git a/t/load_plugins.t b/t/load_plugins.t new file mode 100755 index 0000000..e8b26df --- /dev/null +++ b/t/load_plugins.t @@ -0,0 +1,61 @@ +#!/usr/bin/env perl + +use FindBin qw($Bin); +use lib "$Bin/../t/lib"; + +use Test::More 'no_plan'; + +use_ok('Devel::REPL'); + +my @plugins = qw/ +B::Concise +Colors +Commands +Completion +CompletionDriver::Globals +CompletionDriver::INC +CompletionDriver::Keywords +CompletionDriver::LexEnv +CompletionDriver::Methods +CompletionDriver::Turtles +DDC +DDS +DumpHistory +FancyPrompt +FindVariable +History +Interrupt +LexEnv +MultiLine::PPI +Nopaste +OutputCache +PPI +Packages +Peek +ReadLineHistory +Refresh +ShowClass +Timing +Turtles +/; + +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; + } + } +} + +1;