aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/spec
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-09 03:34:35 +0100
committerMarkus Reiter2017-02-10 17:19:19 +0100
commit59668d27108c34499ae8d00dd9354dc57a112de0 (patch)
tree0b666316fafb32f41f6ef7698632d22753c6b78b /Library/Homebrew/cask/spec
parent92e2e7a21665aad705d76b90735aed854b7a09f5 (diff)
downloadbrew-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.rb25
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