Added Module::Pluggable
[pkg-perl] / deb-src / libmodule-pluggable-perl / libmodule-pluggable-perl-3.8 / t / 02works.t
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
15
16
17 is_deeply(\@plugins, \@expected, "is deeply");
18
19 @plugins = ();
20
21 ok(@plugins = sort MyTest->plugins);
22
23
24
25
26 is_deeply(\@plugins, \@expected, "is deeply class");
27
28
29
30 package MyTest;
31
32 use strict;
33 use Module::Pluggable;
34
35
36 sub new {
37     my $class = shift;
38     return bless {}, $class;
39
40 }
41 1;
42