4 use Test::More tests => 7;
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 with 'MooseX::Runnable::Invocation::Plugin::Role::CmdlineArgs';
37 sub _build_initargs_from_cmdline {
38 return { init => 'fails' };
44 $i = MooseX::Runnable::Invocation->new(
47 '+Plugin' => [qw/foo bar baz/],
50 } 'created invocation without dying';
52 ok $i, 'created invocation ok';
54 is $initargs, 'foo,bar,baz', 'got initargs';
57 MooseX::Runnable::Invocation->new(
60 '+Argless' => ['args go here'],
63 } qr/Perhaps/, 'argless + args = error';
66 MooseX::Runnable::Invocation->new(
72 } 'argless + no args = ok';
75 MooseX::Runnable::Invocation->new(
82 } 'two plugins with args compose OK';