show the first line here when testing with a harness
[gitmo/Moose.git] / t / type_constraints / define_type_twice_throws.t
CommitLineData
07eeacb9 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
b10dde3a 7use Test::Fatal;
07eeacb9 8
28fdde7f 9use 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 18like( 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 25done_testing;