remove unneeded shebangs
[gitmo/MooseX-AlwaysCoerce.git] / t / 02-mx-m-s.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 {
7     package MyClass;
8     use Moose;
9     use Test::Requires {
10         'MooseX::Method::Signatures' => 0.01,
11     };
12     use MooseX::AlwaysCoerce;
13     use Moose::Util::TypeConstraints;
14
15     BEGIN {
16         subtype 'MyType', as 'Int';
17         coerce 'MyType', from 'Str', via { length $_ };
18
19         subtype 'Uncoerced', as 'Int';
20     }
21
22     method foo (MyType :$foo, Uncoerced :$bar) {
23         return "$foo $bar";
24     }
25 }
26
27 use Test::Fatal;
28 use Test::NoWarnings 1.04 ':early';
29 plan tests => 4;
30
31 ok( (my $instance = MyClass->new), 'instance' );
32
33 TODO: {
34     local $TODO = 'need rafl to help with implementation';
35
36     is( exception {
37         is $instance->foo(foo => "text", bar => 42), '4 42';
38     }, undef, 'method called with coerced and uncoerced parameters' )
39         or todo_skip 'is() test never ran', 1;
40 }