test/unpack_strategy: Handle svn unzip unavailable
Skip those tests that require svn or unzip.
This commit is contained in:
		
							parent
							
								
									6a581159e6
								
							
						
					
					
						commit
						879f514e28
					
				@ -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|
 | 
			
		||||
 | 
			
		||||
@ -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"
 | 
			
		||||
 | 
			
		||||
@ -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 }
 | 
			
		||||
 | 
			
		||||
@ -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) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user