6 # Test for a warning when you make the stupid mistake I make all the time
7 # of saying use MooseX::Types::Common qw/NonEmptySimpleStr/;
10 eval { require Capture::Tiny }
11 or plan skip_all => 'Capture::Tiny needed for these tests';
16 use_ok 'MooseX::Types::Common';
18 my ($stdout, $stderr) = Capture::Tiny::capture(sub {
19 MooseX::Types::Common->import;
21 is $stderr, '', 'No warning if nothing imported';
23 ($stdout, $stderr) = Capture::Tiny::capture(sub {
24 MooseX::Types::Common->import('NonEmptySimpleStr');
26 like $stderr, qr/Did you mean/, 'Got warning';
27 like $stderr, qr/NonEmptySimpleStr/, 'Warning mentions bad type';