diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index beafd0db81..4e5a9dc164 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -85,7 +85,11 @@ RSpec.configure do |config| end config.before(:each, :needs_svn) do - skip "Requires subversion." unless which "svn" + skip "subversion not installed." unless which "svn" + end + + config.before(:each, :needs_unzip) do + skip "unzip not installed." unless which("unzip") end config.around(:each) do |example| diff --git a/Library/Homebrew/test/unpack_strategy/jar_spec.rb b/Library/Homebrew/test/unpack_strategy/jar_spec.rb index a180ae82f1..3b5f36ed97 100644 --- a/Library/Homebrew/test/unpack_strategy/jar_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/jar_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples" -describe UnpackStrategy::Jar do +describe UnpackStrategy::Jar, :needs_unzip do let(:path) { TEST_FIXTURE_DIR/"test.jar" } include_examples "UnpackStrategy::detect" diff --git a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb index b56b521caa..4985bcdaf8 100644 --- a/Library/Homebrew/test/unpack_strategy/subversion_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/subversion_spec.rb @@ -1,6 +1,6 @@ require_relative "shared_examples" -describe UnpackStrategy::Subversion do +describe UnpackStrategy::Subversion, :needs_svn do let(:repo) { mktmpdir } let(:working_copy) { mktmpdir } let(:path) { working_copy } diff --git a/Library/Homebrew/test/unpack_strategy/zip_spec.rb b/Library/Homebrew/test/unpack_strategy/zip_spec.rb index 091e1d4582..774cf36fe4 100644 --- a/Library/Homebrew/test/unpack_strategy/zip_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zip_spec.rb @@ -4,7 +4,10 @@ describe UnpackStrategy::Zip do let(:path) { TEST_FIXTURE_DIR/"cask/MyFancyApp.zip" } include_examples "UnpackStrategy::detect" - include_examples "#extract", children: ["MyFancyApp"] + + context "when unzip is available", :needs_unzip do + include_examples "#extract", children: ["MyFancyApp"] + end context "when ZIP archive is corrupted" do let(:path) {