commit the TODO list
[p5sagit/Devel-REPL.git] / t / load_plugins.t
1
2 use strict;
3 use warnings;
4
5 use Test::More;
6 use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
7
8 use_ok('Devel::REPL');
9
10 my @plugins = qw/
11 B::Concise
12 Colors
13 Commands
14 Completion
15 CompletionDriver::Globals
16 CompletionDriver::INC
17 CompletionDriver::Keywords
18 CompletionDriver::LexEnv
19 CompletionDriver::Methods
20 CompletionDriver::Turtles
21 DDC
22 DDS
23 DumpHistory
24 FancyPrompt
25 FindVariable
26 History
27 Interrupt
28 LexEnv
29 MultiLine::PPI
30 Nopaste
31 OutputCache
32 PPI
33 Packages
34 Peek
35 ReadLineHistory
36 Refresh
37 ShowClass
38 Timing
39 Turtles
40 /;
41
42 # one $repl is shared:
43 # "Looks like the problem is that you can't open multiple instances of
44 # Term::ReadLine:Perl from the same object.  I was able to correct this by
45 # changing the test to reuse the same Devel::REPL instance each time.  This
46 # prevents the warning that causes the test to fail.  I don't think this
47 # changes the spirit of the test, it's just a byproduct of how
48 # Term::ReadLine::Perl works." -- RT#84246
49 my $repl = Devel::REPL->new;
50 for my $plugin_name (@plugins) {
51     test_load_plugin($plugin_name);
52 }
53
54 sub test_load_plugin {
55     my ($plugin_name) = @_;
56     my $test_name = "plugin $plugin_name loaded";
57
58     SKIP: {
59         eval "use Devel::REPL::Plugin::$plugin_name; 1"
60             or skip "could not eval plugin $plugin_name", 1;
61
62         ok(eval { $repl->load_plugin($plugin_name); 1 }, $test_name)
63             or diag $@;
64     }
65 }
66
67 done_testing;