X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F02-mx-m-s.t;h=0f1d0718861f600300230a9b31b9a7b6e14a16b9;hb=fc553705e0102a934825453c17767a7adf937f4a;hp=e79bac8bea6d1a4f37ffdcf125718b9aab3e4743;hpb=0d42c8e8c15eb1addd4fb1b1669e89cffc36d7e6;p=gitmo%2FMooseX-AlwaysCoerce.git diff --git a/t/02-mx-m-s.t b/t/02-mx-m-s.t index e79bac8..0f1d071 100644 --- a/t/02-mx-m-s.t +++ b/t/02-mx-m-s.t @@ -1,24 +1,14 @@ -#!/usr/bin/env perl use strict; use warnings; use Test::More; -BEGIN { - if (eval { require MooseX::Method::Signatures }) { - plan tests => 3; - } else { - plan skip_all => 'This test needs MooseX::Method::Signatures'; - } -} - -use Test::Exception; -use Test::NoWarnings; - { package MyClass; use Moose; - use MooseX::Method::Signatures; + use Test::Requires { + 'MooseX::Method::Signatures' => 0.01, + }; use MooseX::AlwaysCoerce; use Moose::Util::TypeConstraints; @@ -34,12 +24,18 @@ use Test::NoWarnings; } } +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;