5 print "1..0 # Skip: can't handle misspelled plugin names\n";
12 use lib "$FindBin::Bin/lib";
13 use Test::More tests => 5;
16 ok($foo = OddTest->new());
19 my @expected = ('OddTest::Plugin::-Dodgy', 'OddTest::Plugin::Foo');
20 ok(@plugins = sort $foo->plugins);
21 is_deeply(\@plugins, \@expected, "is deeply");
24 my @odd_expected = qw(OddTest::Plugin::Foo);
25 ok(@odd_plugins = sort $foo->odd_plugins);
26 is_deeply(\@odd_plugins, \@odd_expected, "is deeply");
29 package OddTest::Pluggable;
32 use base qw(Module::Pluggable::Object);
37 my @files = $self->SUPER::find_files(@_);
38 return grep { !/(^|\/)-/ } $self->SUPER::find_files(@_) ;
44 use Module::Pluggable;
49 return bless {}, $class;
56 my ($pkg, $file) = caller;
57 # the default name for the method is 'plugins'
58 my $sub = $opts{'sub_name'} || 'plugins';
60 my ($package) = $opts{'package'} || "OddTest";
61 $opts{filename} = $file;
62 $opts{package} = $package;
66 my $op = OddTest::Pluggable->new( package => ref($self) );
67 return $op->plugins(@_);