Add tests for "use Moose -extends => [@superclasses]".
gfx [Fri, 14 Aug 2009 00:34:38 +0000 (09:34 +0900)]
t/010_basics/023_extends_command.t [new file with mode: 0755]

diff --git a/t/010_basics/023_extends_command.t b/t/010_basics/023_extends_command.t
new file mode 100755 (executable)
index 0000000..72f0c1a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 7;
+use Test::Exception;
+
+ok(T3->isa('T1'), 'extablish is-a relationship at compile-time');
+
+{
+    package T1;
+    use Moose -extends => [];
+}
+
+{
+    package T2;
+    use Moose -extends => [qw(T1)];
+}
+
+{
+    package T3;
+    use Moose -extends => 'T2';
+}
+
+lives_and {
+    isa_ok(T1->new, 'T1');
+};
+
+lives_and {
+    isa_ok(T2->new, 'T1');
+    isa_ok(T2->new, 'T2');
+};
+
+lives_and {
+    isa_ok(T3->new, 'T1');
+    isa_ok(T3->new, 'T2');
+    isa_ok(T3->new, 'T3');
+};