Make sure that applied_attribute roles don't spill over to other roles to during...
[gitmo/Moose.git] / t / 010_basics / 009_import_unimport.t
index 80e494b..95caad9 100644 (file)
@@ -3,17 +3,17 @@
 use strict;
 use warnings;
 
-use Test::More tests => 42;
+use Test::More;
 
 
 my @moose_exports = qw(
-    extends with 
-    has 
+    extends with
+    has
     before after around
     override
     augment
     super inner
-    make_immutable
+    blessed confess
 );
 
 {
@@ -37,8 +37,8 @@ ok(!Foo->can($_), '... Foo can no longer do ' . $_) for @moose_exports;
 # and check the type constraints as well
 
 my @moose_type_constraint_exports = qw(
-    type subtype as where message 
-    coerce from via 
+    type subtype as where message
+    coerce from via
     enum
     find_type_constraint
 );
@@ -61,3 +61,40 @@ can_ok('Bar', $_) for @moose_type_constraint_exports;
 
 ok(!Bar->can($_), '... Bar can no longer do ' . $_) for @moose_type_constraint_exports;
 
+
+{
+    package Baz;
+
+    use Moose;
+    use Scalar::Util qw( blessed );
+
+    no Moose;
+}
+
+can_ok( 'Baz', 'blessed' );
+
+{
+    package Moo;
+
+    use Scalar::Util qw( blessed );
+    use Moose;
+
+    no Moose;
+}
+
+can_ok( 'Moo', 'blessed' );
+
+my $blessed;
+{
+    package Quux;
+
+    use Scalar::Util qw( blessed );
+    use Moose blessed => { -as => \$blessed };
+
+    no Moose;
+}
+
+can_ok( 'Quux', 'blessed' );
+is( $blessed, \&Scalar::Util::blessed );
+
+done_testing;