summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-12-19 14:02:23 -0600
committerJesse Luehrs <doy@tozt.net>2011-12-19 14:03:29 -0600
commitcb8ebfeb3c38036bb8dd0b5b7d0fcd4274101ffa (patch)
tree1defd1e72b84f795bf5756cd96e99dba7eb20af7 /t
parent9963fffa42a8de2e5e5311db2bd892905f0160e1 (diff)
downloadcircular-require-cb8ebfeb3c38036bb8dd0b5b7d0fcd4274101ffa.tar.gz
circular-require-cb8ebfeb3c38036bb8dd0b5b7d0fcd4274101ffa.zip
fix for use base (Exodist)
Diffstat (limited to 't')
-rw-r--r--t/04-base2.t18
-rw-r--r--t/04/Bar.pm7
-rw-r--r--t/04/Foo.pm9
3 files changed, 34 insertions, 0 deletions
diff --git a/t/04-base2.t b/t/04-base2.t
new file mode 100644
index 0000000..c0be7a7
--- /dev/null
+++ b/t/04-base2.t
@@ -0,0 +1,18 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/04';
+use Test::More;
+use Test::Exception;
+
+# Test passes if you comment this out
+no circular::require;
+
+use_ok('Foo');
+lives_ok { is( Foo->bar, "bar", "Polymorphism" ) }
+ "bar() method available on Foo";
+
+throws_ok { base->import( 'BadWolf' ) }
+ qr|Base class package "BadWolf" is empty|, "use base 'Some Bad File' should throw an exception";
+
+done_testing;
diff --git a/t/04/Bar.pm b/t/04/Bar.pm
new file mode 100644
index 0000000..207dc68
--- /dev/null
+++ b/t/04/Bar.pm
@@ -0,0 +1,7 @@
+package Bar;
+use strict;
+use warnings;
+
+sub bar { "bar" }
+
+1;
diff --git a/t/04/Foo.pm b/t/04/Foo.pm
new file mode 100644
index 0000000..cfb1bb4
--- /dev/null
+++ b/t/04/Foo.pm
@@ -0,0 +1,9 @@
+package Foo;
+use strict;
+use warnings;
+
+use base 'Bar';
+
+sub foo { "foo" }
+
+1;