Skip to content

Commit

Permalink
Fix test/unpack_strategy/zstd for Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
sjackman authored and MikeMcQuaid committed Sep 6, 2022
1 parent 0de4282 commit aa5f6a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Library/Homebrew/test/unpack_strategy/zstd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
describe UnpackStrategy::Zstd do
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

0 comments on commit aa5f6a7

Please sign in to comment.