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 | |
28fdde7f | 9 | use Moose::Util::TypeConstraints; |
07eeacb9 | 10 | |
11 | { | |
12 | package Some::Class; | |
13 | use Moose::Util::TypeConstraints; | |
14 | ||
15 | subtype 'MySubType' => as 'Int' => where { 1 }; | |
16 | } | |
17 | ||
b10dde3a | 18 | like( exception { |
07eeacb9 | 19 | package Some::Other::Class; |
20 | use Moose::Util::TypeConstraints; | |
21 | ||
22 | subtype 'MySubType' => as 'Int' => where { 1 }; | |
b10dde3a | 23 | }, qr/cannot be created again/, 'Trying to create same type twice throws' ); |
07eeacb9 | 24 | |
a28e50e4 | 25 | done_testing; |