Clean up allow and expect.
This commit is contained in:
parent
4a3b8923f2
commit
b1c7f12fbb
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user