Skip to content
Snippets Groups Projects
Commit 7e03b402 authored by Rubén Dávila's avatar Rubén Dávila
Browse files

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

parent 64d0dd18
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,6 +4,8 @@ module Gitlab
include Enumerable
 
def parse(lines)
return [] if lines.blank?
@lines = lines
line_obj_index = 0
line_old = 1
Loading
Loading
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment