X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_basic.t;fp=t%2F001_basic.t;h=48dca2132bf7b190b4cb30e8bcfd37c5a6a7ffa5;hb=053fa19e136de81f8144bd403b5da17c2dbd0c01;hp=3b171a1ab87156d41b1f68b5574527b8e7b8eda2;hpb=19b87ede54eb20f76fafd42a944d56eb0f031dcb;p=gitmo%2FMooseX-Getopt.git diff --git a/t/001_basic.t b/t/001_basic.t index 3b171a1..48dca21 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 173; +use Test::More tests => 185; BEGIN { use_ok('MooseX::Getopt'); @@ -319,3 +319,30 @@ foreach my $parser_name (qw(MooseX::Getopt::Parser::Long MooseX::Getopt::Parser: } } + +# Test default parser +{ + local @ARGV = (); + + my $app = App->new_with_options; + isa_ok($app, 'App'); + + ok(!$app->verbose, '... verbosity is off as expected'); + is($app->length, 24, '... length is 24 as expected'); + is($app->data, 'file.dat', '... data is file.dat as expected'); + is_deeply($app->libs, [], '... libs is [] as expected'); + is_deeply($app->details, {}, '... details is {} as expected'); +} + +{ + local @ARGV = ('--verbose', '--length', 50); + + my $app = App->new_with_options; + isa_ok($app, 'App'); + + ok($app->verbose, '... verbosity is turned on as expected'); + is($app->length, 50, '... length is 50 as expected'); + is($app->data, 'file.dat', '... data is file.dat as expected'); + is_deeply($app->libs, [], '... libs is [] as expected'); + is_deeply($app->details, {}, '... details is {} as expected'); +}