From 59668d27108c34499ae8d00dd9354dc57a112de0 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 9 Feb 2017 03:34:35 +0100 Subject: Convert naked test to spec. --- .../cask/spec/cask/container/naked_spec.rb | 25 ++++++++++++++++++++++ .../cask/test/cask/container/naked_test.rb | 20 ----------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 Library/Homebrew/cask/spec/cask/container/naked_spec.rb delete mode 100644 Library/Homebrew/cask/test/cask/container/naked_test.rb (limited to 'Library') 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 diff --git a/Library/Homebrew/cask/test/cask/container/naked_test.rb b/Library/Homebrew/cask/test/cask/container/naked_test.rb deleted file mode 100644 index d40c16de5..000000000 --- a/Library/Homebrew/cask/test/cask/container/naked_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -require "test_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) - container.extract - - Hbc::FakeSystemCommand.system_calls[expected_command].must_equal 1 - end -end -- cgit v1.2.3