stringify version before comparing, as recommended by Zefram
[p5sagit/Devel-Declare.git] / t / method-installer-runtime.t
index 59375e0..62926b4 100644 (file)
@@ -1,8 +1,6 @@
-
 use strict;
-
-use Test::More tests => 3;
-
+use warnings;
+use Test::More tests => 2;
 use Devel::Declare::MethodInstaller::Simple;
 
 BEGIN {
@@ -12,17 +10,11 @@ BEGIN {
   );
 }
 
-is eval { foo() } , undef;
-like $@, qr/subroutine &main::foo/;
+ok(!main->can('foo'), 'foo() not installed yet');
 
-method foo { 1 }
+method foo {
+    $_[0]->method
+}
 
-is foo(), 1;
+ok(main->can('foo'), 'foo() installed at runtime');
 
-__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.