make all warnings fatal in tests
[gitmo/MooseX-Getopt.git] / t / 109_help_flag.t
index eb75961..a9b8756 100644 (file)
@@ -1,5 +1,3 @@
-#!/usr/bin/env perl
-
 # The documentation claims:
 #   If Getopt::Long::Descriptive is installed and any of the following command
 #   line params are passed (--help, --usage, --?), the program will exit with
 
 # Update: since 0.41, usage info is printed to stdout, not stderr.
 
-use strict; use warnings;
-use Test::More tests => 18;
+use strict; use warnings FATAL => 'all';
+use Test::More tests => 23;
+use Test::NoWarnings 1.04 ':early';
 use Test::Trap;
 
 {
     package MyClass;
-    use strict; use warnings;
+    use strict; use warnings FATAL => 'all';
     use Moose;
     with 'MooseX::Getopt';
 }
@@ -42,7 +41,7 @@ ok($obj->meta->has_attribute('usage'), 'class has usage attribute');
 isa_ok($obj->usage, 'Getopt::Long::Descriptive::Usage');
 my $usage_text = $obj->usage->text;
 
-foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'] )
+foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'], ['-h'] )
 {
     local @ARGV = @$args;
     note "Setting \@ARGV to @$args";