Return an empty Array when there aren't lines to parse.
This commit is contained in:
parent
64d0dd1807
commit
7e03b40221
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue