Commit | Line | Data |
07eeacb9 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
a28e50e4 |
6 | use Test::More; |
b10dde3a |
7 | use Test::Fatal; |
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 | |
b10dde3a |
20 | like( exception { |
07eeacb9 |
21 | package Some::Other::Class; |
22 | use Moose::Util::TypeConstraints; |
23 | |
24 | subtype 'MySubType' => as 'Int' => where { 1 }; |
b10dde3a |
25 | }, qr/cannot be created again/, 'Trying to create same type twice throws' ); |
07eeacb9 |
26 | |
a28e50e4 |
27 | done_testing; |