From: Rhesa Rozendaal Date: Sun, 26 Oct 2008 17:11:49 +0000 (+0000) Subject: added test demonstrating that "method" works at runtime X-Git-Tag: 0.005000~41 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b633fbd21d34e4e2d09592d49bf900ba79845200;p=p5sagit%2FDevel-Declare.git added test demonstrating that "method" works at runtime --- diff --git a/t/method-installer-runtime.t b/t/method-installer-runtime.t new file mode 100644 index 0000000..59375e0 --- /dev/null +++ b/t/method-installer-runtime.t @@ -0,0 +1,28 @@ + +use strict; + +use Test::More tests => 3; + +use Devel::Declare::MethodInstaller::Simple; + +BEGIN { + Devel::Declare::MethodInstaller::Simple->install_methodhandler( + name => 'method', + into => 'main', + ); +} + +is eval { foo() } , undef; +like $@, qr/subroutine &main::foo/; + +method foo { 1 } + +is foo(), 1; + +__END__ +1..2 +Use of uninitialized value $inject in concatenation (.) or string at /opt/perl/lib/site_perl/5.10.0/i686-linux/Devel/Declare/MethodInstaller/Simple.pm line 81. +ok 1 +ok 2 +ok 3 +# Looks like you planned 2 tests but ran 3.