Permalink
Browse files

Make coercion fail due to missing coercion for the Optionally wrapped…

… type.
  • Loading branch information...
1 parent 8102fc7 commit 3aed2ab57a8351c84f75e376a66c25eef2d3af81 @gphat gphat committed with Jan 20, 2010
Showing with 7 additions and 2 deletions.
  1. +1 −1 Makefile.PL
  2. +5 −1 t/basic.t
  3. +1 −0 t/lib/TestClass.pm
View
@@ -23,7 +23,7 @@ requires 'Task::Weaken';
requires 'Text::Balanced';
test_requires 'Test::Exception';
-test_requires 'Test::More' => 0.88;
+test_requires 'Test::More' => 0.89;
repository 'git://github.com/rafl/moosex-method-signatures.git';
bugtracker 'http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Method-Signatures';
View
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More;
use Test::Exception;
use FindBin;
@@ -68,6 +68,8 @@ lives_ok(sub {
lives_ok(sub { $o->with_coercion({}) });
dies_ok(sub { $o->without_coercion({}) });
+lives_ok(sub { $o->named_with_coercion(foo => bless({}, 'MyType')) });
+lives_ok(sub { $o->named_with_coercion(foo => {}) });
# MooseX::Meta::Signature::Combined bug? optional positional can't be omitted
#lives_ok(sub { $o->combined(1, 2, required => 3) });
@@ -77,3 +79,5 @@ use MooseX::Method::Signatures;
my $anon = method ($foo, $bar) { };
isa_ok($anon, 'Moose::Meta::Method');
+
+done_testing;
View
@@ -55,6 +55,7 @@ BEGIN {
method without_coercion (MyType $foo) { $foo }
method with_coercion (MyType $foo does coerce) { $foo }
+method named_with_coercion (MyType :$foo does coerce) { $foo }
no Moose;

0 comments on commit 3aed2ab

Please sign in to comment.