Clean up allow and expect.

This commit is contained in:
JBYoshi 2023-05-12 09:57:12 -05:00
parent 4a3b8923f2
commit b1c7f12fbb
No known key found for this signature in database
GPG Key ID: AE4430116622D05D

View File

@ -341,13 +341,14 @@ describe Cask::Artifact::App, :cask do
source_contents_path = source_path.join("Contents")
target_contents_path = target_path.join("Contents")
expect(app.target).to receive(:writable?).at_least(:once).and_return false
allow(app.target).to receive(:writable?).and_return false
allow(command).to receive(:run!).with(any_args).and_call_original
expect(command).to receive(:run!)
.with("/bin/cp", args: ["-pR", source_contents_path, target_path],
sudo: true)
.and_call_original
expect(FileUtils).not_to receive(:move).with(source_contents_path, target_contents_path)
expect(FileUtils).not_to receive(:move).with(source_contents_path, an_instance_of(Pathname))
app.uninstall_phase(command: command, force: force, successor: cask)
expect(target_contents_path).not_to exist