remove needless use of Capture::Tiny
[gitmo/MooseX-Types-Common.git] / t / 03-idiot.t
1 use strict;
2 use warnings FATAL => 'all';
3
4 use Test::More tests => 2;
5 use Test::Warnings ':no_end_test', ':all';
6 use Test::Deep;
7
8 # Test for a warning when you make the stupid mistake I make all the time
9 # of saying use MooseX::Types::Common qw/NonEmptySimpleStr/;
10
11 require MooseX::Types::Common;
12
13 cmp_deeply(
14     [ warnings { MooseX::Types::Common->import } ],
15     [],
16     'No warning if nothing imported',
17 );
18
19 cmp_deeply(
20     [ warnings { MooseX::Types::Common->import('NonEmptySimpleStr') } ],
21     [ re(qr/Did you mean.*NonEmptySimpleStr/s) ],
22     'Warning mentions bad type',
23 );
24