test case for Moose 1.05 change to the concept of equality
[gitmo/MooseX-Types.git] / t / 18_combined_libs.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use FindBin;
5 use lib "$FindBin::Bin/lib";   
6
7 use Test::More tests => 5;
8 use Test::Exception;
9
10 BEGIN { use_ok 'Combined', qw/Foo2Alias MTFNPY NonEmptyStr/ }
11
12 # test that a type from TestLibrary was exported
13 ok Foo2Alias;
14
15 # test that a type from TestLibrary2 was exported
16 ok MTFNPY;
17
18 is NonEmptyStr->name, 'TestLibrary2::NonEmptyStr',
19     'precedence for conflicting types is correct';
20
21 throws_ok { Combined->import('NonExistentType') }
22 qr/\Qmain asked for a type (NonExistentType) which is not found in any of the type libraries (TestLibrary TestLibrary2) combined by Combined/,
23 'asking for a non-existent type from a combined type library gives a useful error';