8 eval { require MooseX::Method::Signatures };
9 plan skip_all => "No MooseX::Method::Signatures" if $@;
16 use MooseX::Method::Signatures;
17 use MooseX::AlwaysCoerce;
18 use Moose::Util::TypeConstraints;
21 subtype 'MyType', as 'Int';
22 coerce 'MyType', from 'Str', via { length $_ };
24 subtype 'Uncoerced', as 'Int';
27 method foo (MyType :$foo, Uncoerced :$bar) {
32 ok( (my $instance = MyClass->new), 'instance' );
35 is $instance->foo(foo => "text", bar => 42), '4 42';
36 } 'method called with coerced and uncoerced parameters';