summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-16 01:29:09 +0000
committerRobert Speicher <robert@gitlab.com>2016-03-16 01:29:09 +0000
commit374037b8a326b82a7787b2e29da820aa9c4390b3 (patch)
tree6ac454fbf65bd8e22ac372a3cfd87d7f906d9425 /spec
parentc9c14584b79a389f6a558a9a0b20d1b7ded03407 (diff)
parent7e03b40221388bd0567be6609f2ededa7f934179 (diff)
downloadgitlab-ce-374037b8a326b82a7787b2e29da820aa9c4390b3.tar.gz
Merge branch 'issue_14306' into 'master'
Return an empty Array when there aren't lines to parse. Fixes #14306 See merge request !3243
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/diff/parser_spec.rb5
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