diff --git a/Library/Homebrew/test/cask/artifact/app_spec.rb b/Library/Homebrew/test/cask/artifact/app_spec.rb index eefdc2521e..f3ba605472 100644 --- a/Library/Homebrew/test/cask/artifact/app_spec.rb +++ b/Library/Homebrew/test/cask/artifact/app_spec.rb @@ -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