Clean up code for feedback.
This commit is contained in:
parent
29c9921726
commit
84ad387661
@ -94,10 +94,8 @@ module Cask
|
||||
if target.writable?
|
||||
source.children.each { |child| FileUtils.move(child, target/child.basename) }
|
||||
else
|
||||
source.children.each do |child|
|
||||
command.run!("/bin/cp", args: ["-pR", child, target/child.basename],
|
||||
sudo: true)
|
||||
end
|
||||
command.run!("/bin/cp", args: ["-pR", *source.children, target],
|
||||
sudo: true)
|
||||
end
|
||||
Quarantine.copy_xattrs(source, target)
|
||||
source.rmtree
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
describe Cask::Artifact::App, :cask do
|
||||
let(:cask) { Cask::CaskLoader.load(cask_path("local-caffeine")) }
|
||||
let(:command) { SystemCommand }
|
||||
let(:command) { NeverSudoSystemCommand }
|
||||
let(:adopt) { false }
|
||||
let(:force) { false }
|
||||
let(:app) { cask.artifacts.find { |a| a.is_a?(described_class) } }
|
||||
@ -342,12 +342,10 @@ describe Cask::Artifact::App, :cask do
|
||||
|
||||
expect(app.target).to receive(:writable?).at_least(:once).and_return false
|
||||
allow(command).to receive(:run!).and_call_original
|
||||
allow(command).to receive(:run!)
|
||||
.with("/bin/cp", args: ["-pR", source_path.join("Contents"), contents_path],
|
||||
expect(command).to receive(:run!)
|
||||
.with("/bin/cp", args: ["-pR", source_path.join("Contents"), target_path],
|
||||
sudo: true)
|
||||
.and_wrap_original do |original_method, *args, **kwargs|
|
||||
original_method.call(*args, **kwargs, sudo: false)
|
||||
end
|
||||
expect(command).to receive(:run!).with(any_args)
|
||||
expect(FileUtils).not_to receive(:move).with(source_path.join("Contents"), contents_path)
|
||||
|
||||
app.uninstall_phase(command: command, force: force, successor: cask)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user