use strict;
use warnings FATAL => 'all';
-use Test::More 'no_plan';
+use Test::More
+ eval { require Moose }
+ ? (tests => 6)
+ : (skip_all => "Moose required for testing types")
+;
our $skip_no_invocants;
eval q{
- method no_invocant_class_type($arg) {
+ method no_invocant_class_type(Foo::Bar $arg) {
$self->bar($arg);
}
-# method no_invocant_named_param($arg) {
-# $self->bar($arg);
-# }
+ method no_invocant_named_param(Foo :$arg) {
+ $self->bar($arg);
+ }
};
is $@, '', 'compiles without invocant';
my $stuff = Stuff->new;
is( $stuff->no_invocant_class_type(Foo::Bar->new), 'Foo::Bar' );
-#is( $stuff->no_invocant_named_param(arg => Foo->new), 'Foo' );
+is( $stuff->no_invocant_named_param(arg => Foo->new), 'Foo' );