Commit | Line | Data |
3f7169a2 |
1 | #!perl -w |
2 | |
3 | use strict; |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/lib"; |
6 | use Test::More tests => 5; |
7 | |
8 | my $foo; |
9 | ok($foo = MyTest->new()); |
10 | |
11 | my @plugins; |
12 | my @expected = qw(MyTest::Plugin::Bar MyTest::Plugin::Foo MyTest::Plugin::Quux::Foo); |
13 | ok(@plugins = sort $foo->plugins); |
14 | is_deeply(\@plugins, \@expected); |
15 | |
16 | @plugins = (); |
17 | |
18 | ok(@plugins = sort MyTest->plugins); |
19 | is_deeply(\@plugins, \@expected); |
20 | |
21 | |
22 | |
23 | package MyTest; |
24 | use strict; |
25 | sub new { return bless {}, $_[0] } |
26 | |
27 | package MyOtherTest; |
28 | use strict; |
29 | use Module::Pluggable ( package => "MyTest" ); |
30 | sub new { return bless {}, $_[0] } |
31 | |
32 | |
33 | 1; |
34 | |