From dfee012f771015f565474c0864ee02cec1de0215 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Sun, 19 Mar 2023 19:14:46 +0900 Subject: [PATCH] change cask spec to formula one --- Library/Homebrew/test/cmd/fetch_spec.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/test/cmd/fetch_spec.rb b/Library/Homebrew/test/cmd/fetch_spec.rb index 60cf8a5c10..329b8d5dfd 100644 --- a/Library/Homebrew/test/cmd/fetch_spec.rb +++ b/Library/Homebrew/test/cmd/fetch_spec.rb @@ -19,25 +19,27 @@ describe "brew fetch" do expect(HOMEBREW_CACHE/"testball--0.1.tbz").to exist end - it "prevents double fetch (without nuking existing installation)", :integration_test, :needs_macos do - cached_location = Cask::Download.new(local_transmission).fetch + it "prevents double fetch (without nuking existing installation)", :integration_test do + setup_test_formula "testball" + brew "fetch", "testball" - old_ctime = File.stat(cached_location).ctime + old_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime - expect { brew "fetch", "local-transmission", "--cask", "--no-quarantine" }.to be_a_success - new_ctime = File.stat(cached_location).ctime + expect { brew "fetch", "testball", "--no-quarantine" }.to be_a_success + new_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime expect(old_ctime.to_i).to eq(new_ctime.to_i) end - it "allows double fetch with --force", :integration_test, :needs_macos do - cached_location = Cask::Download.new(local_transmission).fetch + it "allows double fetch with --force", :integration_test do + setup_test_formula "testball" + brew "fetch", "testball" - old_ctime = File.stat(cached_location).ctime + old_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime sleep(1) - expect { brew "fetch", "local-transmission", "--cask", "--force", "--no-quarantine" }.to be_a_success - new_ctime = File.stat(cached_location).ctime + expect { brew "fetch", "testball", "--force", "--no-quarantine" }.to be_a_success + new_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime expect(new_ctime.to_i).to be > old_ctime.to_i end