make all warnings fatal in tests
[gitmo/MooseX-ConfigFromFile.git] / t / 04b_getopt.t
CommitLineData
742b859c 1use strict;
bd567467 2use warnings FATAL => 'all';
742b859c 3
4use Test::Requires 'MooseX::Getopt'; # skip all if not installed
5use Test::More tests => 3;
6use Test::NoWarnings 1.04 ':early';
7
8{
9 package Foo::Options;
10
11 use Moose;
12 with qw(MooseX::Getopt MooseX::ConfigFromFile);
13 sub get_config_from_file { }
14}
15
16{
17 package Foo::NoOptions;
18
19 use Moose;
20 with qw(MooseX::ConfigFromFile);
21 sub get_config_from_file { }
22}
23
24ok(
25 Foo::Options->meta->find_attribute_by_name('configfile')->does('MooseX::Getopt::Meta::Attribute::Trait'),
26 'classes with MooseX::Getopt have the Getopt attr trait added',
27);
28
29ok(
30 Foo::NoOptions->meta->find_attribute_by_name('configfile')->does('MooseX::Getopt::Meta::Attribute::Trait'),
31 'when MooseX::Getopt is loaded, the Getopt attr trait is still added',
32);
33