diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index c2af5d43b9aa2..31880ba261158 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(match("#{expected_json}\n").or(match("#{alternate_json}\n"))).to_stdout .and be_a_success end end