Commit | Line | Data |
acf4d245 |
1 | use strict; |
eae6c2c4 |
2 | use warnings FATAL => 'all'; |
acf4d245 |
3 | |
07d22326 |
4 | use Test::More; |
c44948b6 |
5 | use Test::Warnings ':no_end_test', ':all'; |
6 | use Test::Deep; |
acf4d245 |
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 | |
c44948b6 |
11 | require MooseX::Types::Common; |
acf4d245 |
12 | |
c44948b6 |
13 | cmp_deeply( |
14 | [ warnings { MooseX::Types::Common->import } ], |
15 | [], |
16 | 'No warning if nothing imported', |
17 | ); |
acf4d245 |
18 | |
c44948b6 |
19 | cmp_deeply( |
20 | [ warnings { MooseX::Types::Common->import('NonEmptySimpleStr') } ], |
21 | [ re(qr/Did you mean.*NonEmptySimpleStr/s) ], |
22 | 'Warning mentions bad type', |
23 | ); |
acf4d245 |
24 | |
07d22326 |
25 | had_no_warnings if $ENV{AUTHOR_TESTING}; |
26 | done_testing; |