make all warnings fatal in tests
[gitmo/MooseX-Getopt.git] / t / 105_uc_bug_more.t
CommitLineData
d28e4285 1use strict;
aec09248 2use warnings FATAL => 'all';
1f314cdc 3
9fbb5be9 4use Test::More tests => 13;
5use Test::NoWarnings 1.04 ':early';
d28e4285 6use Moose ();
7use Moose::Meta::Class;
8
9foreach my $role (qw/
10 MooseX::Getopt
11 MooseX::Getopt::GLD
12 MooseX::Getopt::Basic
13/) {
14 Class::MOP::load_class($role);
15
16 my $meta = Moose::Meta::Class->create_anon_class(
17 superclasses => ['Moose::Object'],
18 );
19 $meta->add_attribute('Debug', traits => ['Getopt'], isa => 'Bool',
20 cmd_aliases => ['d'], is => 'ro');
21 $role->meta->apply($meta);
22
23 ok($meta->name->new_with_options({ argv => ['-d'] })->Debug,
24 "Debug was set for argv -d on $role");
25 {
26 local @ARGV = ('-d');
27 ok($meta->name->new_with_options()->Debug,
28 "Debug was set for ARGV on $role");
29 }
30
31 ok($meta->name->new_with_options({ argv => ['--Debug'] })->Debug,
32 "Debug was set for argv --Debug on $role");
33
34 ok($meta->name->new_with_options({ argv => ['--debug'] })->Debug,
35 "Debug was set for argv --debug on $role");
36}
37