Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 040_type_constraints / 029_define_type_twice_throws.t
1 #!/usr/bin/perl
2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Exception;
11
12 BEGIN {
13     use_ok('Mouse::Util::TypeConstraints');
14 }
15
16 {
17     package Some::Class;
18     use Mouse::Util::TypeConstraints;
19
20     subtype 'MySubType' => as 'Int' => where { 1 };
21 }
22
23 throws_ok {
24     package Some::Other::Class;
25     use Mouse::Util::TypeConstraints;
26
27     subtype 'MySubType' => as 'Int' => where { 1 };
28 } qr/cannot be created again/, 'Trying to create same type twice throws';
29
30 done_testing;