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