Skip to content

Commit

Permalink
Allow multiple JSON outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Nov 7, 2024
1 parent c17ffb8 commit 5ed1ff4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Library/Homebrew/test/cmd/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5ed1ff4

Please sign in to comment.