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