9 if (eval { require MooseX::Method::Signatures }) {
12 plan skip_all => 'This test needs MooseX::Method::Signatures';
19 use MooseX::Method::Signatures;
20 use MooseX::AlwaysCoerce;
21 use Moose::Util::TypeConstraints;
24 subtype 'MyType', as 'Int';
25 coerce 'MyType', from 'Str', via { length $_ };
27 subtype 'Uncoerced', as 'Int';
30 method foo (MyType :$foo, Uncoerced :$bar) {
35 ok( (my $instance = MyClass->new), 'instance' );
38 is $instance->foo(foo => "text", bar => 42), '4 42';
39 } 'method called with coerced and uncoerced parameters';