From aa5f6a7ccd9b7a07b0f57b54c10db5257d32bce3 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Thu, 1 Sep 2022 12:21:30 -0700 Subject: [PATCH] Fix test/unpack_strategy/zstd for Ubuntu 22.04 --- Library/Homebrew/test/unpack_strategy/zstd_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb index 6e9198b996..270db9ce40 100644 --- a/Library/Homebrew/test/unpack_strategy/zstd_spec.rb +++ b/Library/Homebrew/test/unpack_strategy/zstd_spec.rb @@ -6,5 +6,12 @@ require_relative "shared_examples" 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