19 lines
634 B
Ruby
Raw Normal View History

2017-03-05 19:26:56 +01:00
describe Hbc::Container::Naked, :cask do
2016-08-18 22:11:42 +03:00
it "saves files with spaces in them from uris with encoded spaces" do
cask = Hbc::Cask.new("spacey") do
url "http://example.com/kevin%20spacey.pkg"
version "1.2"
end
path = Pathname("/tmp/downloads/kevin-spacey.pkg")
2016-08-18 22:11:42 +03:00
expected_destination = cask.staged_path.join("kevin spacey.pkg")
2018-07-22 23:13:32 +02:00
container = Hbc::Container::Naked.new(cask, path)
2016-08-18 22:11:42 +03:00
2018-07-22 23:13:32 +02:00
expect(container).to receive(:system_command!)
.with("/usr/bin/ditto", args: ["--", path, expected_destination])
2018-07-22 23:13:32 +02:00
container.extract(to: cask.staged_path, basename: "kevin spacey.pkg")
2016-08-18 22:11:42 +03:00
end
end