summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2013-03-13 05:17:51 -0400
committerDavid Golden <dagolden@cpan.org>2013-03-13 05:17:51 -0400
commit439d06e8d403f8c3ba328570f108a0a96afe02b5 (patch)
tree37396eb08ac243cf948e42fba44306575d19cf64
parentfbba604b4bf31df59fefe9ef13a420e52c6005de (diff)
fix homedir mocking for t/app.t
-rw-r--r--t/app.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/app.t b/t/app.t
index b30dd6e..266e231 100644
--- a/t/app.t
+++ b/t/app.t
@@ -11,12 +11,17 @@ my @LR_ARGS = (qw(--offline -r http://example.tld/cpan -l), $TARGET);
delete $ENV{CPAN_MINI_CONFIG};
+{
+ no warnings 'redefine';
+ *File::HomeDir::my_home = sub { $ENV{HOME} };
+}
+
sub config_dir {
my ($config) = @_;
my $tempdir = tempdir(CLEANUP => 1);
- return unless defined $config;
+ return $tempdir unless defined $config;
my $filename = File::Spec->catfile($tempdir, '.minicpanrc');
open my $config_fh, '>', $filename or die "can't write to $filename: $!";