Add end_location to json formatter

This commit is contained in:
Vitalii Elenhaupt 2018-06-11 22:56:13 +03:00 committed by V. Elenhaupt
parent f8d14d4222
commit 23245d0e52
2 changed files with 29 additions and 1 deletions

View file

@ -54,6 +54,19 @@ module Ameba
location["line"].should eq 1
location["column"].should eq 2
end
it "shows issue end_location" do
s = Source.new ""
s.add_issue DummyRule.new,
Crystal::Location.new("path", 3, 3),
Crystal::Location.new("path", 5, 4),
"message"
result = get_result [s]
end_location = result["sources"][0]["issues"][0]["end_location"]
end_location["line"].should eq 5
end_location["column"].should eq 4
end
end
context "summary" do