-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add isolated tests for Mohawks include-default patch
- Loading branch information
1 parent
6e6930b
commit fc0a0e4
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use Test::More tests => 3; | ||
use ExtUtils::Manifest qw( maniskip ); | ||
use Cwd qw( getcwd ); | ||
|
||
# ABSTRACT: Ensure include-default is memory only | ||
|
||
use lib 't/tlib'; | ||
use Test::TempDir::Tiny; | ||
|
||
my $cwd = getcwd(); | ||
END { chdir $cwd } | ||
|
||
my $tempdir = tempdir(); | ||
chdir $tempdir; | ||
|
||
{ | ||
open my $fh, '>', 'MANIFEST.SKIP' or die "Can't open MANIFEST.SKIP for writing. $!"; | ||
print {$fh} qq[#!include_default] or die "Error writing to MANIFEST.SKIP. $!"; | ||
close $fh or die "Error closing MANIFEST.SKIP. $!" | ||
} | ||
|
||
my $skipchk = maniskip(); | ||
|
||
my $skipcontents; | ||
{ | ||
open my $fh, '<', 'MANIFEST.SKIP' or die "Can't open MANIFEST.SKIP for reading. $!"; | ||
local $/ = undef; | ||
$skipcontents = <$fh>; | ||
close $fh or warn "Error closing MANIFEST.SKIP. $!"; | ||
} | ||
|
||
unlike( $skipcontents, qr/#!start\s*included/, 'include_default not expanded on disk' ); | ||
|
||
ok( $skipchk->('Makefile'), 'Makefile still skipped by default' ); | ||
ok( !$skipchk->('Makefile.PL'), 'Makefile.PL still not skipped by default' ); | ||
|
||
done_testing; |