Resolve several failing tests
[gitmo/Mouse.git] / t / 040_type_constraints / 029_define_type_twice_throws.t
CommitLineData
b2b106d7 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7use Test::Exception;
8
9BEGIN {
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
20throws_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