use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 110_sort_usage_by_attr_order.t
index 1e41e79..c025680 100644 (file)
@@ -8,13 +8,14 @@
 # early), followed by options added by parent classes and roles, and then
 # options added by this class.
 
-use strict; use warnings;
-use Test::More tests => 1;
-use Test::Exception;
+use strict;
+use warnings FATAL => 'all';
+use Test::More tests => 2;
+use Test::Warnings;
 
 {
     package MyClass;
-    use strict; use warnings;
+    use strict; use warnings FATAL => 'all';
     use Moose;
     with 'MooseX::Getopt';
 
@@ -27,13 +28,12 @@ use Test::Exception;
 
 my $obj = MyClass->new_with_options();
 
-my $expected = <<USAGE;
-usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
-       -? --usage --help  Prints this usage information.
-       --foo              Documentation for "foo"
-       --bar              Documentation for "bar"
-       --baz              Documentation for "baz"
+my $expected = <<"USAGE";
+usage: 110_sort_usage_by_attr_order.t [-?h] [long options...]
+\t-h -? --usage --help  Prints this usage information.
+\t--foo                Documentation for "foo"
+\t--bar                Documentation for "bar"
+\t--baz                Documentation for "baz"
 USAGE
 
 is($obj->usage->text, $expected, 'Usage text has nicely sorted options');
-