add missing stopwords
[gitmo/MooseX-Types.git] / t / 11_library-definition.t
index 59d77b5..484d597 100644 (file)
@@ -5,15 +5,14 @@ use strict;
 use Test::More;
 use FindBin;
 use lib "$FindBin::Bin/lib";
-use TestLibrary ':all';
+use TestLibrary qw( NonEmptyStr IntArrayRef ),
+                Foo2Alias => { -as => 'Foo' };
 
 my @tests = (
     [ 'NonEmptyStr', 12, "12", [], "foobar", "" ],
     [ 'IntArrayRef', 12, [12], {}, [17, 23], {} ],
 );
 
-plan tests => (@tests * 8) + 3;
-
 # new array ref so we can safely shift from it
 for my $data (map { [@$_] } @tests) {
     my $type = shift @$data;
@@ -41,9 +40,15 @@ for my $data (map { [@$_] } @tests) {
     }
 }
 
+# aliasing test
+ok my $code = __PACKAGE__->can('Foo'),      'aliased type exported under correct symbol';
+is $code->(), 'TestLibrary::Foo2Alias',     'aliased type returns unaliased type name';
+
 # coercion not available
 ok ! __PACKAGE__->can('to_TwentyThree'), "type without coercion doesn't have to_* helper";
 
 eval { require TestNamespaceSep };
 ok   $@,                q(trying to declare a type with '::' in it croaks);
 like $@, qr/Foo::Bar/,  q(error message contains type name);
+
+done_testing;