From ee68f813d812dd7e04efd500a138525752017c32 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Mon, 11 Jul 2022 15:04:10 -0700 Subject: [PATCH] cask/cmd/list_spec.rb: fix leaky version variable The lazy evaluation in let() was failing to reset MacOS#full_version to the original_macos_version. This meant that all tests run after this one automatically had MacOS#version == 12 which caused some of the tests to fail if you were running a different macOS version. --- Library/Homebrew/test/cask/cmd/list_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/test/cask/cmd/list_spec.rb b/Library/Homebrew/test/cask/cmd/list_spec.rb index 77b6e7af89..b09c8ae9ae 100644 --- a/Library/Homebrew/test/cask/cmd/list_spec.rb +++ b/Library/Homebrew/test/cask/cmd/list_spec.rb @@ -246,7 +246,7 @@ describe Cask::Cmd::List, :cask do ] EOS } - let(:original_macos_version) { MacOS.full_version.to_s } + let!(:original_macos_version) { MacOS.full_version.to_s } before do # Use a more limited symbols list to shorten the variations hash