Commit | Line | Data |
---|---|---|
b633fbd2 | 1 | use strict; |
d17a5ab4 | 2 | use warnings; |
72a03bb0 | 3 | use Test::More tests => 2; |
b633fbd2 | 4 | use Devel::Declare::MethodInstaller::Simple; |
5 | ||
6 | BEGIN { | |
7 | Devel::Declare::MethodInstaller::Simple->install_methodhandler( | |
8 | name => 'method', | |
9 | into => 'main', | |
10 | ); | |
11 | } | |
12 | ||
72a03bb0 | 13 | ok(!main->can('foo'), 'foo() not installed yet'); |
b633fbd2 | 14 | |
09ca664a | 15 | method foo { |
16 | $_[0]->method | |
17 | } | |
b633fbd2 | 18 | |
72a03bb0 | 19 | ok(main->can('foo'), 'foo() installed at runtime'); |
b633fbd2 | 20 |