change cask spec to formula one

This commit is contained in:
hyuraku 2023-03-19 19:14:46 +09:00
parent 7d90e3a2a1
commit dfee012f77

View File

@ -19,25 +19,27 @@ describe "brew fetch" do
expect(HOMEBREW_CACHE/"testball--0.1.tbz").to exist expect(HOMEBREW_CACHE/"testball--0.1.tbz").to exist
end end
it "prevents double fetch (without nuking existing installation)", :integration_test, :needs_macos do it "prevents double fetch (without nuking existing installation)", :integration_test do
cached_location = Cask::Download.new(local_transmission).fetch 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 expect { brew "fetch", "testball", "--no-quarantine" }.to be_a_success
new_ctime = File.stat(cached_location).ctime new_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime
expect(old_ctime.to_i).to eq(new_ctime.to_i) expect(old_ctime.to_i).to eq(new_ctime.to_i)
end end
it "allows double fetch with --force", :integration_test, :needs_macos do it "allows double fetch with --force", :integration_test do
cached_location = Cask::Download.new(local_transmission).fetch 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) sleep(1)
expect { brew "fetch", "local-transmission", "--cask", "--force", "--no-quarantine" }.to be_a_success expect { brew "fetch", "testball", "--force", "--no-quarantine" }.to be_a_success
new_ctime = File.stat(cached_location).ctime new_ctime = File.stat(HOMEBREW_CACHE/"testball--0.1.tbz").ctime
expect(new_ctime.to_i).to be > old_ctime.to_i expect(new_ctime.to_i).to be > old_ctime.to_i
end end