Commit 374037b8 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'issue_14306' into 'master'

Return an empty Array when there aren't lines to parse.

Fixes #14306

See merge request !3243
parents c9c14584 7e03b402
......@@ -4,6 +4,8 @@ module Gitlab
include Enumerable
def parse(lines)
return [] if lines.blank?
@lines = lines
line_obj_index = 0
line_old = 1
......
......@@ -90,4 +90,9 @@ eos
end
end
end
context 'when lines is empty' do
it { expect(parser.parse([])).to eq([]) }
it { expect(parser.parse(nil)).to eq([]) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment