From 30c4663066b2b95b54fb0bbece8cb13fd8545735 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Sat, 4 Dec 2021 12:29:31 -0500 Subject: [PATCH] Fix analytics string to test for CI --- Library/Homebrew/test/utils/analytics_spec.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/test/utils/analytics_spec.rb b/Library/Homebrew/test/utils/analytics_spec.rb index 11fd3a8bd4..509ac677f6 100644 --- a/Library/Homebrew/test/utils/analytics_spec.rb +++ b/Library/Homebrew/test/utils/analytics_spec.rb @@ -11,11 +11,13 @@ describe Utils::Analytics do described_class.clear_os_arch_prefix_ci end + ci = ", CI" if ENV["CI"] + it "returns OS_VERSION and prefix when HOMEBREW_PREFIX is a custom prefix on intel" do allow(Hardware::CPU).to receive(:type).and_return(:intel) allow(Hardware::CPU).to receive(:in_rosetta2?).and_return(false) allow(Homebrew).to receive(:default_prefix?).and_return(false) - expected = "#{OS_VERSION}, #{described_class.custom_prefix_label}" + expected = "#{OS_VERSION}, #{described_class.custom_prefix_label}#{ci}" expect(described_class.os_arch_prefix_ci).to eq expected end @@ -23,7 +25,7 @@ describe Utils::Analytics do allow(Hardware::CPU).to receive(:type).and_return(:arm) allow(Hardware::CPU).to receive(:in_rosetta2?).and_return(false) allow(Homebrew).to receive(:default_prefix?).and_return(false) - expected = "#{OS_VERSION}, ARM, #{described_class.custom_prefix_label}" + expected = "#{OS_VERSION}, ARM, #{described_class.custom_prefix_label}#{ci}" expect(described_class.os_arch_prefix_ci).to eq expected end @@ -31,7 +33,7 @@ describe Utils::Analytics do allow(Hardware::CPU).to receive(:type).and_return(:intel) allow(Hardware::CPU).to receive(:in_rosetta2?).and_return(true) allow(Homebrew).to receive(:default_prefix?).and_return(false) - expected = "#{OS_VERSION}, Rosetta, #{described_class.custom_prefix_label}" + expected = "#{OS_VERSION}, Rosetta, #{described_class.custom_prefix_label}#{ci}" expect(described_class.os_arch_prefix_ci).to eq expected end