remove unneeded shebangs
[gitmo/MooseX-Types-Common.git] / t / 03-idiot.t
CommitLineData
acf4d245 1use strict;
eae6c2c4 2use warnings FATAL => 'all';
acf4d245 3
4use Test::More;
5
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/;
8
9BEGIN {
10 eval { require Capture::Tiny }
11 or plan skip_all => 'Capture::Tiny needed for these tests';
12}
13
14plan tests => 4;
15
16use_ok 'MooseX::Types::Common';
17
18my ($stdout, $stderr) = Capture::Tiny::capture(sub {
19 MooseX::Types::Common->import;
20});
21is $stderr, '', 'No warning if nothing imported';
22
23($stdout, $stderr) = Capture::Tiny::capture(sub {
24 MooseX::Types::Common->import('NonEmptySimpleStr');
25});
26like $stderr, qr/Did you mean/, 'Got warning';
27like $stderr, qr/NonEmptySimpleStr/, 'Warning mentions bad type';
28