when Makefile.PL is run non-interactively, default features are added to runtime...
[p5sagit/Devel-REPL.git] / t / load_plugins.t
CommitLineData
d6d18343 1
5dcad11c 2use strict;
3use warnings;
1680cce5 4
3e2f4695 5use Test::More;
ee9bf440 6use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
3e2f4695 7
1680cce5 8use_ok('Devel::REPL');
9
10my @plugins = qw/
11B::Concise
12Colors
13Commands
14Completion
15CompletionDriver::Globals
16CompletionDriver::INC
17CompletionDriver::Keywords
18CompletionDriver::LexEnv
19CompletionDriver::Methods
20CompletionDriver::Turtles
21DDC
22DDS
23DumpHistory
24FancyPrompt
25FindVariable
26History
27Interrupt
28LexEnv
29MultiLine::PPI
30Nopaste
31OutputCache
32PPI
33Packages
34Peek
35ReadLineHistory
36Refresh
37ShowClass
38Timing
39Turtles
40/;
41
d6d18343 42# one $repl is shared:
43# "Looks like the problem is that you can't open multiple instances of
6bba7e87 44# Term::ReadLine:Perl from the same object. I was able to correct this by
d6d18343 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
49my $repl = Devel::REPL->new;
1680cce5 50for my $plugin_name (@plugins) {
51 test_load_plugin($plugin_name);
52}
53
54sub test_load_plugin {
55 my ($plugin_name) = @_;
1680cce5 56 my $test_name = "plugin $plugin_name loaded";
59500b7e 57
58 SKIP: {
59 eval "use Devel::REPL::Plugin::$plugin_name; 1"
60 or skip "could not eval plugin $plugin_name", 1;
61
8448bc60 62 ok(eval { $repl->load_plugin($plugin_name); 1 }, $test_name)
63 or diag $@;
1680cce5 64 }
65}
66
3e2f4695 67done_testing;