Resolve several failing tests
[gitmo/Mouse.git] / t / 040_type_constraints / 029_define_type_twice_throws.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 2;
7 use Test::Exception;
8
9 BEGIN {
10     use_ok('Mouse::Util::TypeConstraints');
11 }
12
13 {
14     package Some::Class;
15     use Mouse::Util::TypeConstraints;
16
17     subtype 'MySubType' => as 'Int' => where { 1 };
18 }
19
20 throws_ok {
21     package Some::Other::Class;
22     use Mouse::Util::TypeConstraints;
23
24     subtype 'MySubType' => as 'Int' => where { 1 };
25 } qr/cannot be created again/, 'Trying to create same type twice throws';
26