diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index c2af5d43b9aa2..94749286423c0 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(/\A(#{Regexp.escape(expected_json)}|#{Regexp.escape(alternate_json)})\n\z/)).to_stdout .and be_a_success end end