Re: localising hash element by variable
[p5sagit/p5-mst-13.2.git] / t / Module_Pluggable / 19can_ok_clobber.t
CommitLineData
3f7169a2 1#!/usr/bin/perl
2use strict;
3use warnings;
4use Data::Dumper;
5use FindBin;
6use lib "$FindBin::Bin/lib";
7
8use Test::More tests=>5;
9
10#use_ok( 'MyTest' );
11#diag "Module::Pluggable::VERSION $Module::Pluggable::VERSION";
12
13my @plugins = MyTest->plugins;
14my @plugins_after;
15
16use_ok( 'MyTest::Plugin::Foo' );
17ok( my $foo = MyTest::Plugin::Foo->new() );
18
19@plugins_after = MyTest->plugins;
20is_deeply(
21 \@plugins_after,
22 \@plugins,
23 "plugins haven't been clobbered",
24);
25
26can_ok ($foo, 'frobnitz');
27
28@plugins_after = MyTest->plugins;
29is_deeply(
30 \@plugins_after,
31 \@plugins,
32 "plugins haven't been clobbered",
33) or diag Dumper ;
34
35
36
37package MyTest;
38
39use strict;
40use Module::Pluggable;
41
42
43sub new {
44 my $class = shift;
45 return bless {}, $class;
46
47}
481;
49
50