Merge pull request #4671 from sjackman/test-svn-unzip

test/unpack_strategy: Handle svn unzip unavailable
This commit is contained in:
Shaun Jackman 2018-08-13 17:18:08 -07:00 committed by GitHub
commit 2141ce3814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -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|

View File

@ -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"

View File

@ -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 }

View File

@ -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) {