X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F010_dashes.t;h=004ca710c1b921de44ae327011564e168ef95a6e;hb=0cdc0384ddb0c3be31312270a986ef74c77db300;hp=52b784947c1d26bf7592573360f4c7b037d2ec7e;hpb=fe193b814520900810bc4c0e6d9819d444b26930;p=gitmo%2FMooseX-Getopt.git diff --git a/t/010_dashes.t b/t/010_dashes.t index 52b7849..004ca71 100644 --- a/t/010_dashes.t +++ b/t/010_dashes.t @@ -1,11 +1,9 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 5; - -use Test::Exception; +use Test::More tests => 8; +use Test::Fatal; +use Test::NoWarnings 1.04 ':early'; BEGIN { @@ -24,20 +22,20 @@ BEGIN { { local @ARGV = (qw/--some-thingy bar/); - lives_and { is( App->new_with_options->some_thingy, 'bar') } 'Dash in option name'; + ok ! exception { is( App->new_with_options->some_thingy, 'bar') }, 'Dash in option name'; } { local @ARGV = (qw/--some_thingy bar/); - throws_ok { App->new_with_options } qr/Unknown option: some_thingy/; + like exception { App->new_with_options }, qr/Unknown option: some_thingy/; } { local @ARGV = (qw/--another_thingy bar/); - lives_and { is( App->new_with_options->another_thingy, 'bar' ) } 'Underscore in option name'; + ok ! exception { is( App->new_with_options->another_thingy, 'bar' ) }, 'Underscore in option name'; } { local @ARGV = (qw/--another-thingy bar/); - throws_ok { App->new_with_options } qr/Unknown option: another-thingy/; + like exception { App->new_with_options }, qr/Unknown option: another-thingy/; }