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 = "/tmp/downloads/kevin-spacey-1.2.pkg"
|
|
|
|
expected_destination = cask.staged_path.join("kevin spacey.pkg")
|
|
|
|
expected_command = ["/usr/bin/ditto", "--", path, expected_destination]
|
|
|
|
Hbc::FakeSystemCommand.stubs_command(expected_command)
|
|
|
|
|
|
|
|
container = Hbc::Container::Naked.new(cask, path, Hbc::FakeSystemCommand)
|
|
|
|
|
2017-02-09 03:34:35 +01:00
|
|
|
expect {
|
2017-07-29 19:55:05 +02:00
|
|
|
container.extract
|
2017-02-09 03:34:35 +01:00
|
|
|
}.not_to raise_error
|
|
|
|
|
|
|
|
expect(Hbc::FakeSystemCommand.system_calls[expected_command]).to eq(1)
|
2016-08-18 22:11:42 +03:00
|
|
|
end
|
|
|
|
end
|