Skip to content

Commit

Permalink
Improve module hiding for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
xdg committed Jun 28, 2016
1 parent 26f287e commit e846ce1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Revision history for Path-Tiny

{{$NEXT}}

[Tests]

- Improved method for hiding some modules during tests.

0.094 2016-05-23 12:45:19-04:00 America/New_York

- Fixed Changes note typo in 0.092. 0.092 had no changes since 0.091,
Expand Down
8 changes: 4 additions & 4 deletions t/input_output_no_PU_UU.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use warnings;
use Test::More 0.96;

# Tiny equivalent of Devel::Hide
BEGIN {
$INC{'Unicode/UTF8.pm'} = undef;
$INC{'PerlIO/utf8_strict.pm'} = undef;
}
use lib map {
my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} );
sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh }
} qw{Unicode/UTF8.pm PerlIO/utf8_strict.pm};

note "Hiding Unicode::UTF8 and PerlIO::utf8_strict";

Expand Down
8 changes: 5 additions & 3 deletions t/input_output_no_UU.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use warnings;
use Test::More 0.96;

# Tiny equivalent of Devel::Hide
BEGIN {
$INC{'Unicode/UTF8.pm'} = undef;
}
# Tiny equivalent of Devel::Hide
use lib map {
my ( $m, $c ) = ( $_, qq{die "Can't locate $_ (hidden)\n"} );
sub { return unless $_[1] eq $m; open my $fh, "<", \$c; return $fh }
} qw{Unicode/UTF8.pm};

note "Hiding Unicode::UTF8";

Expand Down

0 comments on commit e846ce1

Please sign in to comment.