2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-23 20:59:21 +02:00
|
|
|
require_relative "shared_examples"
|
|
|
|
|
2024-02-18 15:11:11 -08:00
|
|
|
RSpec.describe UnpackStrategy::Zip do
|
2018-07-23 20:59:21 +02:00
|
|
|
let(:path) { TEST_FIXTURE_DIR/"cask/MyFancyApp.zip" }
|
|
|
|
|
|
|
|
include_examples "UnpackStrategy::detect"
|
2018-08-13 10:04:32 -07:00
|
|
|
|
|
|
|
context "when unzip is available", :needs_unzip do
|
|
|
|
include_examples "#extract", children: ["MyFancyApp"]
|
|
|
|
end
|
2018-07-23 20:59:21 +02:00
|
|
|
|
|
|
|
context "when ZIP archive is corrupted" do
|
2023-03-08 23:14:46 +00:00
|
|
|
let(:path) do
|
2018-07-23 20:59:21 +02:00
|
|
|
(mktmpdir/"test.zip").tap do |path|
|
|
|
|
FileUtils.touch path
|
|
|
|
end
|
2023-03-08 23:14:46 +00:00
|
|
|
end
|
2018-07-23 20:59:21 +02:00
|
|
|
|
|
|
|
include_examples "UnpackStrategy::detect"
|
|
|
|
end
|
|
|
|
end
|