summaryrefslogtreecommitdiff
path: root/ext/Module-Pluggable/t/10innerpack_onefile.t
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Module-Pluggable/t/10innerpack_onefile.t')
-rw-r--r--ext/Module-Pluggable/t/10innerpack_onefile.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/Module-Pluggable/t/10innerpack_onefile.t b/ext/Module-Pluggable/t/10innerpack_onefile.t
new file mode 100644
index 0000000000..01caf3738e
--- /dev/null
+++ b/ext/Module-Pluggable/t/10innerpack_onefile.t
@@ -0,0 +1,27 @@
+#!perl -wT
+
+use strict;
+use Test::More tests => 2;
+use Data::Dumper;
+
+my $mc = MyClass->new();
+my $mc2 = MyClass2->new();
+
+
+is_deeply([$mc->plugins], [qw(MyClass::Plugin::MyPlugin)], "Got inner plugin");
+is_deeply([$mc2->plugins], [], "Didn't get plugin");
+
+package MyClass::Plugin::MyPlugin;
+sub pretty { print "I am pretty" };
+
+package MyClass;
+use Module::Pluggable inner => 1;
+
+sub new { return bless {}, $_[0] }
+
+package MyClass2;
+use Module::Pluggable search_path => "MyClass::Plugin", inner => 0;
+
+sub new { return bless {}, $_[0] }
+1;
+