From 92630ffd147a8676f3c5a809a991bae840903c79 Mon Sep 17 00:00:00 2001 From: Ryosuke Ito Date: Thu, 3 Feb 2022 13:43:07 +0900 Subject: [PATCH] Try to reproduce https://github.com/danger/danger/issues/1332 --- .../request_sources/bitbucket_server_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/lib/danger/request_sources/bitbucket_server_spec.rb b/spec/lib/danger/request_sources/bitbucket_server_spec.rb index 5b25d2127..d9c5e0cd5 100644 --- a/spec/lib/danger/request_sources/bitbucket_server_spec.rb +++ b/spec/lib/danger/request_sources/bitbucket_server_spec.rb @@ -46,4 +46,21 @@ end end end + + describe "#inline_violations_group" do + context "with multiple violations with the same severity to the same file and path" do + it "sorts violations without raising an error" do + warnings = [ + Danger::Violation.new("foo", false, "file.rb", 1, type: :warning), + Danger::Violation.new("bar", false, "file.rb", 1, type: :warning) + ] + expect(bs.inline_violations_group(warnings: warnings)).to eq({ + warnings: warnings, + errors: [], + messages: [], + markdowns: [] + }) + end + end + end end