From: matthewt Date: Sun, 5 Dec 2010 19:22:58 +0000 (+0000) Subject: test for load_module fixes X-Git-Tag: release_0.9.3~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cd4896a8f533cff4844bee527fafca00bcf16cc5;p=gitmo%2FMoo.git test for load_module fixes --- diff --git a/t/load_module.t b/t/load_module.t new file mode 100644 index 0000000..290f071 --- /dev/null +++ b/t/load_module.t @@ -0,0 +1,18 @@ +use strictures 1; +use Test::More; +use Moo::_Utils; + +local @INC = (sub { + return unless $_[1] eq 'Foo/Bar.pm'; + my $source = "package Foo::Bar; sub baz { 1 } 1"; + open my $fh, '<', \$source; + $fh; +}, @INC); + +{ package Foo::Bar::Baz; sub quux { } } + +_load_module("Foo::Bar"); + +ok(eval { Foo::Bar->baz }, 'Loaded module ok'); + +done_testing;