[Bast-commits] r4997 - Devel-Declare/1.000/trunk/t

rhesa at dev.catalyst.perl.org rhesa at dev.catalyst.perl.org
Sun Oct 26 17:11:49 GMT 2008


Author: rhesa
Date: 2008-10-26 17:11:49 +0000 (Sun, 26 Oct 2008)
New Revision: 4997

Added:
   Devel-Declare/1.000/trunk/t/method-installer-runtime.t
Log:
added test demonstrating that "method" works at runtime

Added: Devel-Declare/1.000/trunk/t/method-installer-runtime.t
===================================================================
--- Devel-Declare/1.000/trunk/t/method-installer-runtime.t	                        (rev 0)
+++ Devel-Declare/1.000/trunk/t/method-installer-runtime.t	2008-10-26 17:11:49 UTC (rev 4997)
@@ -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.




More information about the Bast-commits mailing list