Add Moose::Deprecated, and clean up use of deprecated features in tests
[gitmo/Moose.git] / t / 050_metaclasses / 020_metaclass_parameterized_traits.t
index cd6e5ad..dec5952 100644 (file)
@@ -1,8 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More skip_all => "Feature not implemented yet";
-#use Test::More tests => 1;
+use Test::More;
 
 {
     package My::Trait;
@@ -18,12 +17,32 @@ use Test::More skip_all => "Feature not implemented yet";
     package My::Class;
     use Moose -traits => [
         'My::Trait' => {
-            alias => {
+            -alias => {
                 reversed_name => 'enam',
             },
         },
     ];
 }
 
-is(My::Class->meta->enam, 'ssalC::yM', 'parameterized trait applied');
+{
+    package My::Other::Class;
+    use Moose -traits => [
+        'My::Trait' => {
+            -alias => {
+                reversed_name => 'reversed',
+            },
+            -excludes => 'reversed_name',
+        },
+    ];
+}
+
+my $meta = My::Class->meta;
+is($meta->enam, 'ssalC::yM', 'parameterized trait applied');
+ok(!$meta->can('reversed'), "the method was not installed under the other class' alias");
+
+my $other_meta = My::Other::Class->meta;
+is($other_meta->reversed, 'ssalC::rehtO::yM', 'parameterized trait applied');
+ok(!$other_meta->can('enam'), "the method was not installed under the other class' alias");
+ok(!$other_meta->can('reversed_name'), "the method was not installed under the original name when that was excluded");
 
+done_testing;