From e11a768c556bb4fb4d3f706f37caaf9b76fb2804 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 7 Nov 2024 09:34:44 -0800 Subject: [PATCH] Allow multiple JSON outputs --- Library/Homebrew/test/cmd/outdated_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index c2af5d43b9aa2..c12a7118aa549 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -20,9 +20,12 @@ }], casks: [], }) + # json v2.8.1 is inconsistent it how it renders empty arrays, + # for now we allow multiple outputs: + alternate_json = expected_json.gsub("[]", "[\n\n]") expect { brew "outdated", "--json=v2" } - .to output("#{expected_json}\n").to_stdout + .to output(eq("#{expected_json}\n").or(eq("#{alternate_json}\n"))).to_stdout .and be_a_success end end