| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use FindBin; |
| 4 |
use lib "$FindBin::Bin/../../"; |
| 5 |
use Test::More; |
| 6 |
use t::Util; |
| 7 |
|
| 8 |
test_app('.pm file in the root', sub { |
| 9 |
my $tmpdir = shift; |
| 10 |
|
| 11 |
test_file("$tmpdir/MyTest.pm", <<'END'); |
| 12 |
use strict; |
| 13 |
use warnings; |
| 14 |
END |
| 15 |
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}}); |
| 16 |
|
| 17 |
test_app('.pm file under lib', sub { |
| 18 |
my $tmpdir = shift; |
| 19 |
|
| 20 |
test_file("$tmpdir/lib/MyTest.pm", <<'END'); |
| 21 |
use strict; |
| 22 |
use warnings; |
| 23 |
END |
| 24 |
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}}); |
| 25 |
|
| 26 |
test_app('inc', sub { |
| 27 |
my $tmpdir = shift; |
| 28 |
|
| 29 |
test_file("$tmpdir/MyTest.pm", <<'END'); |
| 30 |
use strict; |
| 31 |
use warnings; |
| 32 |
use Foo::Bar; |
| 33 |
END |
| 34 |
|
| 35 |
test_file("$tmpdir/inc/Foo/Bar.pm", <<'END'); |
| 36 |
package Foo::Bar; |
| 37 |
1; |
| 38 |
END |
| 39 |
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}}); |
| 40 |
|
| 41 |
test_app('ignore local file', sub { |
| 42 |
my $tmpdir = shift; |
| 43 |
|
| 44 |
test_file("$tmpdir/MyTest.pm", <<'END'); |
| 45 |
use strict; |
| 46 |
use warnings; |
| 47 |
END |
| 48 |
|
| 49 |
test_file("$tmpdir/MyTest2.pm", <<'END'); |
| 50 |
use MyTest; |
| 51 |
END |
| 52 |
}, {}, { runtime => { requires => { strict => 0, warnings => 0 }}}); |
| 53 |
|
| 54 |
test_app('ignore Makefile.PL under t', sub { |
| 55 |
my $tmpdir = shift; |
| 56 |
|
| 57 |
test_file("$tmpdir/t/Makefile.PL", <<'END'); |
| 58 |
use strict; |
| 59 |
use warnings; |
| 60 |
use Foo; |
| 61 |
END |
| 62 |
}, {}); |
| 63 |
|
| 64 |
done_testing; |