Check if the dir exists before getting rid of it
Errietta Kostala [Wed, 28 Jan 2015 16:14:36 +0000 (16:14 +0000)]
t/07google.t

index 37d7d74..7816957 100644 (file)
@@ -27,7 +27,7 @@ LWP::Protocol::PSGI->register(stemmaweb->psgi_app);
 
 my $ua = Test::WWW::Mechanize->new;
 
-io("$FindBin::Bin/var")->rmtree;
+io("$FindBin::Bin/var")->rmtree if io("$FindBin::Bin/var")->exists;
 
 {
     my $scope = $dir->new_scope;
@@ -222,6 +222,6 @@ io("$FindBin::Bin/var")->rmtree;
     $ua->content_contains('Hello! 4242!', 'We are logged in.');
 }
 
-io("$FindBin::Bin/var")->rmtree;
+io("$FindBin::Bin/var")->rmtree if io("$FindBin::Bin/var")->exists;
 
 done_testing;