From: Rhesa Rozendaal Date: Mon, 27 Oct 2008 03:20:25 +0000 (+0000) Subject: changed runtime test to use can() X-Git-Tag: 0.005000~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72a03bb0f3ba57200f70eb56f2f239a6a19efdb3;hp=2a7079617d08587bf5d80ec48daac4157f214405;p=p5sagit%2FDevel-Declare.git changed runtime test to use can() --- diff --git a/t/method-installer-runtime.t b/t/method-installer-runtime.t index c16ea5d..e7c0683 100644 --- a/t/method-installer-runtime.t +++ b/t/method-installer-runtime.t @@ -1,9 +1,8 @@ use strict; -use Test::More tests => 3; +use Test::More tests => 2; -use lib 'lib'; use Devel::Declare::MethodInstaller::Simple; # suppress warnings @@ -16,10 +15,9 @@ BEGIN { ); } -is eval { foo() } , undef; -like $@, qr/subroutine &main::foo/; +ok(!main->can('foo'), 'foo() not installed yet'); -method foo { 1 } +method foo { } -is foo(), 1; +ok(main->can('foo'), 'foo() installed at runtime');