Commit | Line | Data |
---|---|---|
b633fbd2 | 1 | |
2 | use strict; | |
3 | ||
72a03bb0 | 4 | use Test::More tests => 2; |
b633fbd2 | 5 | |
6 | use Devel::Declare::MethodInstaller::Simple; | |
7 | ||
2a707961 | 8 | # suppress warnings |
9 | sub Devel::Declare::MethodInstaller::Simple::parse_proto { '' } | |
10 | ||
b633fbd2 | 11 | BEGIN { |
12 | Devel::Declare::MethodInstaller::Simple->install_methodhandler( | |
13 | name => 'method', | |
14 | into => 'main', | |
15 | ); | |
16 | } | |
17 | ||
72a03bb0 | 18 | ok(!main->can('foo'), 'foo() not installed yet'); |
b633fbd2 | 19 | |
72a03bb0 | 20 | method foo { } |
b633fbd2 | 21 | |
72a03bb0 | 22 | ok(main->can('foo'), 'foo() installed at runtime'); |
b633fbd2 | 23 |