Fix analytics_spec.rb test to pass when run from M1

This commit is contained in:
Nipunn Koorapati 2021-12-03 20:14:17 -05:00
parent 371122da55
commit e2fc14b0b7

View File

@ -14,7 +14,9 @@ describe Utils::Analytics do
it "returns OS_VERSION and prefix when HOMEBREW_PREFIX is a custom prefix" do
allow(Hardware::CPU).to receive(:type).and_return(:intel)
allow(Homebrew).to receive(:default_prefix?).and_return(false)
expect(described_class.os_arch_prefix_ci).to include("#{OS_VERSION}, #{described_class.custom_prefix_label}")
arch = ", #{described_class.arch_label}" if described_class.arch_label.present?
expected = "#{OS_VERSION}#{arch}, #{described_class.custom_prefix_label}"
expect(described_class.os_arch_prefix_ci).to include(expected)
end
it "does not include prefix when HOMEBREW_PREFIX is the default prefix" do