Fix test/unpack_strategy/zstd for Ubuntu 22.04

This commit is contained in:
Shaun Jackman 2022-09-01 12:21:30 -07:00 committed by Mike McQuaid
parent 0de4282511
commit aa5f6a7ccd
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -6,5 +6,12 @@ require_relative "shared_examples"
describe UnpackStrategy::Zstd do describe UnpackStrategy::Zstd do
let(:path) { TEST_FIXTURE_DIR/"cask/container.tar.zst" } let(:path) { TEST_FIXTURE_DIR/"cask/container.tar.zst" }
include_examples "UnpackStrategy::detect" it "is correctly detected" do
# UnpackStrategy.detect(path) for a .tar.XXX file returns either UnpackStrategy::Tar if
# the host's tar is able to extract that compressed file or UnpackStrategy::XXX otherwise,
# such as UnpackStrategy::Zstd. On macOS UnpackStrategy.detect("container.tar.zst")
# returns UnpackStrategy::Zstd, and on ubuntu-22.04 it returns UnpackStrategy::Tar,
# because the host's version of tar is recent enough and zstd is installed.
expect(UnpackStrategy.detect(path)).to(be_a(described_class).or(be_a(UnpackStrategy::Tar)))
end
end end