From 623e2d95af6c04dca5b3de94443095fb1d25ce3b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 28 Jan 2021 08:13:08 +0000 Subject: [PATCH] Revert "cleanup_spec: inline path creation." This reverts commit 3724c739f880945ec76a16ef8b9209c6440f0035. --- Library/Homebrew/test/cleanup_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index bdff8c4f7a..f8c363ad44 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -199,8 +199,11 @@ describe Homebrew::Cleanup do describe "::cleanup_logs" do let(:path) { (HOMEBREW_LOGS/"delete_me") } - it "cleans all logs if prune is 0" do + before do path.mkpath + end + + it "cleans all logs if prune is 0" do described_class.new(days: 0).cleanup_logs expect(path).not_to exist end @@ -208,7 +211,6 @@ describe Homebrew::Cleanup do it "cleans up logs if older than 30 days" do allow_any_instance_of(Pathname).to receive(:ctime).and_return(31.days.ago) allow_any_instance_of(Pathname).to receive(:mtime).and_return(31.days.ago) - path.mkpath subject.cleanup_logs expect(path).not_to exist end @@ -216,7 +218,6 @@ describe Homebrew::Cleanup do it "does not clean up logs less than 30 days old" do allow_any_instance_of(Pathname).to receive(:ctime).and_return(15.days.ago) allow_any_instance_of(Pathname).to receive(:mtime).and_return(15.days.ago) - path.mkpath subject.cleanup_logs expect(path).to exist end