« Dist-Zilla-PluginBundle-BAREFOOT-0.05_01/t/build.t
↑ Summary
Dist-Zilla-PluginBundle-BAREFOOT-0.05_01/t/require.t »
| 1 | 1 | ▶ | use Test::Most 0.25; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Dist::Zilla::App; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Path::Tiny qw< path cwd tempdir >; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $tdist = tempdir( CLEANUP => 1 ); | |||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | # go to our temp dir for this test | ||||||||||
| 11 | 1 | my $old = cwd; | |||||||||
| 12 | 1 | ▶ | END { chdir $old } # go back to original dir so cleanup of temp dir can happen | ||||||||
|
Subroutine
END: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | chdir $tdist; | |||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | # create a skeletal distribution | ||||||||||
| 17 | |||||||||||
| 18 | 1 | my $tname = 'Test-Module'; | |||||||||
| 19 | 1 | my $tversion = '0.01'; | |||||||||
| 20 | |||||||||||
| 21 | 1 | path('dist.ini')->spew( <<END ); | |||||||||
| 22 | name = $tname | ||||||||||
| 23 | author = Buddy Burden <barefoot\@cpan.org> | ||||||||||
| 24 | license = Artistic_2_0 | ||||||||||
| 25 | copyright_holder = Buddy Burden | ||||||||||
| 26 | |||||||||||
| 27 | version = $tversion | ||||||||||
| 28 | [\@BAREFOOT] | ||||||||||
| 29 | fake_release = 1 | ||||||||||
| 30 | repository_link = none | ||||||||||
| 31 | END | ||||||||||
| 32 | |||||||||||
| 33 | 1 | my $lib = path( 'lib', 'Test' ); | |||||||||
| 34 | 1 | $lib->mkpath; | |||||||||
| 35 | 1 | $lib->path('Module.pm')->spew( <<'END' ); | |||||||||
| 36 | # blank lines before and after PODCLASSNAME are required by PodnameFromClassname | ||||||||||
| 37 | # (for whatever reason) | ||||||||||
| 38 | |||||||||||
| 39 | # PODCLASSNAME | ||||||||||
| 40 | |||||||||||
| 41 | class Test::Module with Some::Role | ||||||||||
| 42 | { | ||||||||||
| 43 | # ABSTRACT: Just a module for testing | ||||||||||
| 44 | # VERSION | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 1; | ||||||||||
| 48 | END | ||||||||||
| 49 | |||||||||||
| 50 | 1 | my $t = path( 't' ); | |||||||||
| 51 | 1 | $t->mkpath; | |||||||||
| 52 | 1 | $t->path('require.t')->spew( <<'END' ); | |||||||||
| 53 | use Test::Most 0.25; | ||||||||||
| 54 | |||||||||||
| 55 | require_ok( 'Test::Module' ); | ||||||||||
| 56 | |||||||||||
| 57 | done_testing; | ||||||||||
| 58 | END | ||||||||||
| 59 | |||||||||||
| 60 | |||||||||||
| 61 | # now build our test dist so we can have some files to test | ||||||||||
| 62 | |||||||||||
| 63 | 1 | run_dzil_command("build"); | |||||||||
| 64 | 0 | ▶ | chdir "$tname-$tversion" or die("failed to run dzil"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | |||||||||||
| 66 | 0 | my $meta = path('META.json')->slurp; | |||||||||
| 67 | |||||||||||
| 68 | 0 | like $meta, qr/"version" \s* : \s* "$tversion"/x, 'version is correct in meta'; | |||||||||
| 69 | 0 | like $meta, qr/"provides" \s* : /x, 'contains a `provides` in meta'; | |||||||||
| 70 | |||||||||||
| 71 | |||||||||||
| 72 | 0 | done_testing; | |||||||||
| 73 | |||||||||||
| 74 | |||||||||||
| 75 | sub run_dzil_command | ||||||||||
| 76 | 1 | ▶ | { | ||||||||
|
Subroutine
run_dzil_command: called CC=1 SCAR=0.0
| |||||||||||
| 77 | 1 | local @ARGV = @_; | |||||||||
| 78 | 1 | Dist::Zilla::App->run; | |||||||||
| 79 | } | ||||||||||