summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
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;