X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02-mx-m-s.t;h=0f1d0718861f600300230a9b31b9a7b6e14a16b9;hb=bb4a98dc91f85fd0f14f85fdcb7c620aecbd33de;hp=c79c947d7ac64e10c96f04ac3fd35000ed13051d;hpb=4239a8b1c5b35083561fe62652840f86e4fcac68;p=gitmo%2FMooseX-AlwaysCoerce.git diff --git a/t/02-mx-m-s.t b/t/02-mx-m-s.t index c79c947..0f1d071 100644 --- a/t/02-mx-m-s.t +++ b/t/02-mx-m-s.t @@ -1,22 +1,14 @@ -#!/usr/bin/env perl use strict; use warnings; use Test::More; -use Test::Exception; - -BEGIN { - if (eval { require MooseX::Method::Signatures }) { - plan tests => 2; - } else { - plan skip_all => 'This test needs MooseX::Method::Signatures'; - } -} { package MyClass; use Moose; - use MooseX::Method::Signatures; + use Test::Requires { + 'MooseX::Method::Signatures' => 0.01, + }; use MooseX::AlwaysCoerce; use Moose::Util::TypeConstraints; @@ -32,12 +24,18 @@ BEGIN { } } +use Test::Fatal; +use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; + ok( (my $instance = MyClass->new), 'instance' ); TODO: { local $TODO = 'need rafl to help with implementation'; - lives_and { + is( exception { is $instance->foo(foo => "text", bar => 42), '4 42'; - } 'method called with coerced and uncoerced parameters'; + }, undef, 'method called with coerced and uncoerced parameters' ) + or todo_skip 'is() test never ran', 1; } + +done_testing;