Merge extends.t and auto-subclass.t into subclass.t
gfx [Mon, 11 Jan 2010 06:43:51 +0000 (15:43 +0900)]
t/001_mouse/002-subclass.t [moved from t/001_mouse/005-extends.t with 55% similarity]
t/001_mouse/004-auto-subclass.t [deleted file]

similarity index 55%
rename from t/001_mouse/005-extends.t
rename to t/001_mouse/002-subclass.t
index 31d7d24..9dc7973 100644 (file)
@@ -1,20 +1,34 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 7;
+use Test::More;
 use lib 't/lib';
 
+# auto-subclass
 do {
     package Class;
     use Mouse;
+};
+
+can_ok(Class => 'new');
+
+my $object = Class->new;
+
+isa_ok($object => 'Class');
+isa_ok($object => 'Mouse::Object');
+
+# extends()
+do {
+    package ParentClass;
+    use Mouse;
 
     package Child;
     use Mouse;
-    extends 'Class';
+    extends 'ParentClass';
 
     package Mouse::TestClass;
     use Mouse;
-    extends 'Unsweetened';
+    extends 'Unsweetened'; # in t/lib
 
     sub mouse { 1 }
 };
@@ -24,16 +38,17 @@ can_ok(Child => 'new');
 my $child = Child->new;
 
 isa_ok($child => 'Child');
-isa_ok($child => 'Class');
+isa_ok($child => 'ParentClass');
 isa_ok($child => 'Mouse::Object');
 
 can_ok('Mouse::TestClass' => qw(mouse unsweetened));
 
-eval "
+eval q{
     package Child;
     use Mouse;
-";
+};
 
-isa_ok($child => 'Class');
+isa_ok($child => 'ParentClass');
 isa_ok($child => 'Mouse::Object');
 
+done_testing;
diff --git a/t/001_mouse/004-auto-subclass.t b/t/001_mouse/004-auto-subclass.t
deleted file mode 100644 (file)
index 2f4045b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use Test::More tests => 3;
-
-do {
-    package Class;
-    use Mouse;
-};
-
-can_ok(Class => 'new');
-
-my $object = Class->new;
-
-isa_ok($object => 'Class');
-isa_ok($object => 'Mouse::Object');
-