Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-03-16 03:51:27 +0300
committerRubén Dávila <rdavila84@gmail.com>2016-03-16 03:51:27 +0300
commit7e03b40221388bd0567be6609f2ededa7f934179 (patch)
tree2158edc267c768e6d109522a07f60978b3930167 /spec
parent64d0dd1807c75be21a8f5bfe3a74b9230b5b8979 (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.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