4 use Test::More tests => 6;
6 use MooseX::Runnable::Invocation;
12 with 'MooseX::Runnable';
18 with 'MooseX::Runnable::Invocation::Plugin::Role::CmdlineArgs';
20 has 'init' => ( is => 'ro', required => 1 );
22 sub _build_initargs_from_cmdline {
24 $initargs = join ',', @_;
25 return { init => 'args' };
35 $i = MooseX::Runnable::Invocation->new(
38 '+Plugin' => [qw/foo bar baz/],
41 } 'created invocation without dying';
43 ok $i, 'created invocation ok';
45 is $initargs, 'foo,bar,baz', 'got initargs';
48 MooseX::Runnable::Invocation->new(
51 '+Argless' => ['args go here'],
54 } qr/Perhaps/, 'argless + args = error';
57 MooseX::Runnable::Invocation->new(
63 } 'argless + no args = ok';