use strict;
use warnings;
use Test::Exception;
-use Test::More tests => 4;
+use Test::More tests => 6;
use MooseX::Runnable::Invocation;
}
}
+{ package Argless;
+ use Moose::Role;
+}
+
my $i;
lives_ok {
$i = MooseX::Runnable::Invocation->new(
ok $i->run, 'ran ok';
is $initargs, 'foo,bar,baz', 'got initargs';
+throws_ok {
+ MooseX::Runnable::Invocation->new(
+ class => 'Class',
+ plugins => {
+ '+Argless' => ['args go here'],
+ },
+ );
+} qr/Perhaps/, 'argless + args = error';
-
+lives_ok {
+ MooseX::Runnable::Invocation->new(
+ class => 'Class',
+ plugins => {
+ '+Argless' => [],
+ },
+ );
+} 'argless + no args = ok';