If we re-import Mouse, don't thrash the class's superclasses.
Shawn M Moore [Tue, 10 Jun 2008 01:04:37 +0000 (01:04 +0000)]
lib/Mouse.pm
t/005-extends.t

index d2b2fc6..fce4bd8 100644 (file)
@@ -62,8 +62,9 @@ do {
         strict->import;
         warnings->import;
 
-        no strict 'refs';
-        @{ $CALLER . '::ISA' } = 'Mouse::Object';
+        my $meta = Mouse::Class->initialize($CALLER);
+        $meta->superclasses('Mouse::Object')
+            unless $meta->superclasses;
 
         goto $exporter;
     }
index c84fd00..d3d6af1 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 5;
+use Test::More tests => 7;
 use lib 't/lib';
 
 do {
@@ -29,3 +29,11 @@ isa_ok($child => 'Mouse::Object');
 
 can_ok('Mouse::TestClass' => qw(mouse antimouse));
 
+eval "
+    package Child;
+    use Mouse;
+";
+
+isa_ok($child => 'Class');
+isa_ok($child => 'Mouse::Object');
+