X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbasic-mx-getopt.t;h=a1dda47569a64c3bbd6c0c37898ff7025b7280f9;hb=1924178262e396bcb9cb649a894ca31647e9c231;hp=6bafdb9168f3fb467c01b1eb367d750aa107a71f;hpb=6568c67dc4decc059123a6e6c83d450bf19e2b58;p=gitmo%2FMooseX-Runnable.git diff --git a/t/basic-mx-getopt.t b/t/basic-mx-getopt.t index 6bafdb9..a1dda47 100644 --- a/t/basic-mx-getopt.t +++ b/t/basic-mx-getopt.t @@ -1,7 +1,7 @@ use strict; use warnings; use Test::Exception; -use Test::More tests => 5; +use Test::More tests => 9; use MooseX::Runnable::Invocation; use ok 'MooseX::Runnable::Invocation::Scheme::MooseX::Getopt'; @@ -25,17 +25,27 @@ my $foo; } } -my $invocation = MooseX::Runnable::Invocation->new( - class => 'Class', -); +{ package Class2; + use Moose; + extends 'Class'; +} + +foreach my $class (qw(Class Class2)) +{ + my $invocation = MooseX::Runnable::Invocation->new( + class => $class, + ); -ok $invocation; + ok $invocation, 'class is instantiatable'; -my $code; -lives_ok { - $code = $invocation->run('--foo', '42', 0); -} 'run lived'; + my $code; + lives_ok { + $code = $invocation->run('--foo', '42', 0); + } 'run lived'; + + is $foo, '42', 'got foo from cmdline'; + + is $code, 0, 'exit status ok'; +} -is $foo, '42', 'got foo from cmdline'; -is $code, 0, 'exit status ok';