| 1 | #!perl -w |
| 2 | |
| 3 | use strict; |
| 4 | use FindBin; |
| 5 | use lib (($FindBin::Bin."/lib")=~/^(.*)$/); |
| 6 | use Test::More tests => 3; |
| 7 | |
| 8 | |
| 9 | |
| 10 | my $t = InnerTest->new(); |
| 11 | |
| 12 | my %plugins = map { $_ => 1 } $t->plugins; |
| 13 | |
| 14 | ok(keys %plugins, "Got some plugins"); |
| 15 | ok($plugins{'InnerTest::Plugin::Foo'}, "Got Foo"); |
| 16 | ok($plugins{'InnerTest::Plugin::Bar'}, "Got Bar - the inner package"); |
| 17 | |
| 18 | |
| 19 | |
| 20 | package InnerTest; |
| 21 | use strict; |
| 22 | use Module::Pluggable inner => 1; |
| 23 | use base qw(Module::Pluggable); |
| 24 | |
| 25 | |
| 26 | sub new { |
| 27 | my $class = shift; |
| 28 | return bless {}, $class; |
| 29 | |
| 30 | } |
| 31 | |
| 32 | |
| 33 | 1; |
| 34 | |