Version 0.37
[gitmo/MooseX-Getopt.git] / t / 109_help_flag.t
index c60c272..70a95ab 100644 (file)
@@ -18,7 +18,7 @@
 
 use strict; use warnings;
 use Test::More tests => 6;
-use Test::Exception;
+use Test::Fatal;
 
 {
     package MyClass;
@@ -29,7 +29,7 @@ use Test::Exception;
 
 # before fix, prints this on stderr:
 #Unknown option: ?
-#usage: test1.t 
+#usage: test1.t
 
 # after fix, prints this on stderr:
 #usage: test1.t [-?] [long options...]
@@ -39,7 +39,7 @@ foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'] )
 {
     local @ARGV = @$args;
 
-    throws_ok { MyClass->new_with_options() }
+    like exception { MyClass->new_with_options() },
         qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help  Prints this usage information.\E$/ms,
         'Help request detected; usage information properly printed';
 }