Commit | Line | Data |
5e03b55c |
1 | # this test is replicated to t/load_module_role_tiny.t for Role::Tiny |
2 | |
2215d4b9 |
3 | # work around RT#67692 |
4 | use Moo::_Utils; |
cd4896a8 |
5 | use strictures 1; |
2215d4b9 |
6 | |
cd4896a8 |
7 | use Test::More; |
cd4896a8 |
8 | |
9 | local @INC = (sub { |
10 | return unless $_[1] eq 'Foo/Bar.pm'; |
11 | my $source = "package Foo::Bar; sub baz { 1 } 1"; |
12 | open my $fh, '<', \$source; |
13 | $fh; |
14 | }, @INC); |
15 | |
16 | { package Foo::Bar::Baz; sub quux { } } |
17 | |
18 | _load_module("Foo::Bar"); |
19 | |
20 | ok(eval { Foo::Bar->baz }, 'Loaded module ok'); |
21 | |
22 | done_testing; |