import some (modified) MXMS tests
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / too_many_args.t
1 #!perl
2 use strict;
3 use warnings FATAL => 'all';
4 use Test::More;
5 use Test::Fatal;
6
7 {
8     package Foo;
9     use Function::Parameters qw(:strict);
10
11         method new($class:) { bless {}, $class }
12     method foo ($bar) { $bar }
13 }
14
15 my $o = Foo->new;
16 is(exception { $o->foo(42) }, undef);
17 like(exception { $o->foo(42, 23) }, qr/Too many arguments/);
18
19 done_testing;