2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-23 20:59:21 +02:00
|
|
|
require "unpack_strategy"
|
|
|
|
|
2024-02-18 15:13:05 -08:00
|
|
|
RSpec.shared_examples "UnpackStrategy::detect" do
|
2018-07-23 20:59:21 +02:00
|
|
|
it "is correctly detected" do
|
|
|
|
expect(UnpackStrategy.detect(path)).to be_a described_class
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-02-18 15:13:05 -08:00
|
|
|
RSpec.shared_examples "#extract" do |children: []|
|
2018-07-23 20:59:21 +02:00
|
|
|
specify "#extract" do
|
|
|
|
mktmpdir do |unpack_dir|
|
|
|
|
described_class.new(path).extract(to: unpack_dir)
|
|
|
|
expect(unpack_dir.children(false).map(&:to_s)).to match_array children
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|