diff options
| author | Markus Reiter | 2017-02-09 03:34:35 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-10 17:19:19 +0100 |
| commit | 59668d27108c34499ae8d00dd9354dc57a112de0 (patch) | |
| tree | 0b666316fafb32f41f6ef7698632d22753c6b78b /Library/Homebrew/cask/spec | |
| parent | 92e2e7a21665aad705d76b90735aed854b7a09f5 (diff) | |
| download | brew-59668d27108c34499ae8d00dd9354dc57a112de0.tar.bz2 | |
Convert naked test to spec.
Diffstat (limited to 'Library/Homebrew/cask/spec')
| -rw-r--r-- | Library/Homebrew/cask/spec/cask/container/naked_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/spec/cask/container/naked_spec.rb b/Library/Homebrew/cask/spec/cask/container/naked_spec.rb new file mode 100644 index 000000000..ee4102eca --- /dev/null +++ b/Library/Homebrew/cask/spec/cask/container/naked_spec.rb @@ -0,0 +1,25 @@ +require "spec_helper" + +describe Hbc::Container::Naked do + 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) + + expect { + shutup do + container.extract + end + }.not_to raise_error + + expect(Hbc::FakeSystemCommand.system_calls[expected_command]).to eq(1) + end +end |
