59375e0a8be878a2a5e0e9e2ba194bafb76ad025
[p5sagit/Devel-Declare.git] / t / method-installer-runtime.t
1
2 use strict;
3
4 use Test::More tests => 3;
5
6 use Devel::Declare::MethodInstaller::Simple;
7
8 BEGIN {
9   Devel::Declare::MethodInstaller::Simple->install_methodhandler(
10     name => 'method',
11     into => 'main',
12   );
13 }
14
15 is eval { foo() } , undef;
16 like $@, qr/subroutine &main::foo/;
17
18 method foo { 1 }
19
20 is foo(), 1;
21
22 __END__
23 1..2
24 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.
25 ok 1
26 ok 2
27 ok 3
28 # Looks like you planned 2 tests but ran 3.