Merge and_call_original instruction into expect() calls.

This commit is contained in:
JBYoshi 2023-05-11 17:09:27 -05:00
parent 84ad387661
commit 7a108d3db0
No known key found for this signature in database
GPG Key ID: AE4430116622D05D

View File

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