From 606cfd4c723b5d9a48a9d4a292edf225eecd703a Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Tue, 23 Jun 2015 13:42:32 +1200 Subject: [PATCH] Add isolated tests for Mohawks include-default patch --- t/maniskip.include-default.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 t/maniskip.include-default.t diff --git a/t/maniskip.include-default.t b/t/maniskip.include-default.t new file mode 100644 index 0000000..9f718a4 --- /dev/null +++ b/t/maniskip.include-default.t @@ -0,0 +1,26 @@ +use strict; +use warnings; + +use Test::More tests => 3; +use ExtUtils::Manifest qw( maniskip ); + +# ABSTRACT: Ensure include-default is memory only + +use lib 't/tlib'; +use Test::TempDir::Tiny qw( in_tempdir ); +use ByteSlurper qw( write_bytes read_bytes ); + +in_tempdir 'no-default-expansions' => sub { + + write_bytes( 'MANIFEST.SKIP', qq[#!include_default] ); + + my $skipchk = maniskip(); + + my $skipcontents = read_bytes('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;