diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-03-16 03:51:27 +0300 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-03-16 03:51:27 +0300 |
commit | 7e03b40221388bd0567be6609f2ededa7f934179 (patch) | |
tree | 2158edc267c768e6d109522a07f60978b3930167 /spec | |
parent | 64d0dd1807c75be21a8f5bfe3a74b9230b5b8979 (diff) |
Return an empty Array when there aren't lines to parse.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/diff/parser_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb index f576c39284e..cdff063a9ed 100644 --- a/spec/lib/gitlab/diff/parser_spec.rb +++ b/spec/lib/gitlab/diff/parser_spec.rb @@ -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 |