Merge branch 'issue_14306' into 'master'

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

Fixes #14306

See merge request !3243
This commit is contained in:
Robert Speicher 2016-03-16 01:29:09 +00:00
commit 374037b8a3
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,8 @@ module Gitlab
include Enumerable
def parse(lines)
return [] if lines.blank?
@lines = lines
line_obj_index = 0
line_old = 1

View file

@ -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