« blib/lib/Pod/Weaver/PluginBundle/BAREFOOT.pm
↑ Summary
Dist-Zilla-PluginBundle-BAREFOOT-0.05_01/t/tdist.t »
| 1 | 1 | ▶ | use Test::Most 0.25; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use Test::Command 0.10; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | ▶ | use Path::Class; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use File::Temp qw< tempdir >; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | |||||||||||
| 8 | 1 | my $dir = tempdir( CLEANUP => 1 ); | |||||||||
| 9 | |||||||||||
| 10 | 1 | my @filter_out = | |||||||||
| 11 | ( | ||||||||||
| 12 | '\[DZ\].*', | ||||||||||
| 13 | '\[(@BAREFOOT/)?ReadmeAnyFromPod\] (?i:overrid\w+) README\.pod in root', | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | # pop back up to actual dist dir for this test | ||||||||||
| 18 | # if doing an actual install, there is no actual dist dir, so just skip all | ||||||||||
| 19 | #diag `pwd ; ls`; | ||||||||||
| 20 | 1 | ▶ | sub inside_build_dir { grep { $_ eq '.build' } dir()->absolute->components } | ||||||||
|
Subroutine
inside_build_dir: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | ▶ | plan skip_all => "can't understand my current directory structure [" . dir()->absolute . "]" unless inside_build_dir(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | ▶ | chdir '..' while inside_build_dir(); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | |||||||||||
| 24 | # try to build again, but in a temp dir | ||||||||||
| 25 | # * keeps from building in a build dir, which does very wonky things | ||||||||||
| 26 | # * tempdir can be cleaned up automatically, so no need to do a dzil clean | ||||||||||
| 27 | # ** (which is good, because clean doesn't take an --in param) | ||||||||||
| 28 | 0 | my $cmd = Test::Command->new( cmd => "dzil build --in $dir" ); | |||||||||
| 29 | 0 | my $stdout = $cmd->stdout_value; | |||||||||
| 30 | 0 | my $stderr = $cmd->stderr_value; | |||||||||
| 31 | |||||||||||
| 32 | # remove lines we don't care about | ||||||||||
| 33 | 0 | for ($stdout, $stderr) | |||||||||
| 34 | { | ||||||||||
| 35 | 0 | foreach my $pattern (@filter_out) | |||||||||
| 36 | { | ||||||||||
| 37 | 0 | s/^$pattern\n//mg; | |||||||||
| 38 | } | ||||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | is $stdout, '', 'no unexpected lines in build'; | |||||||||
| 42 | 0 | is $stderr, '', 'no error lines in build'; | |||||||||
| 43 | |||||||||||
| 44 | |||||||||||
| 45 | 0 | done_testing; | |||||||||