Commit | Line | Data |
07eeacb9 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
a28e50e4 |
6 | use Test::More; |
53a4d826 |
7 | use Test::Exception; |
07eeacb9 |
8 | |
9 | BEGIN { |
10 | use_ok('Moose::Util::TypeConstraints'); |
11 | } |
12 | |
13 | { |
14 | package Some::Class; |
15 | use Moose::Util::TypeConstraints; |
16 | |
17 | subtype 'MySubType' => as 'Int' => where { 1 }; |
18 | } |
19 | |
53a4d826 |
20 | throws_ok { |
07eeacb9 |
21 | package Some::Other::Class; |
22 | use Moose::Util::TypeConstraints; |
23 | |
24 | subtype 'MySubType' => as 'Int' => where { 1 }; |
53a4d826 |
25 | } qr/cannot be created again/, 'Trying to create same type twice throws'; |
07eeacb9 |
26 | |
a28e50e4 |
27 | done_testing; |