summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJon Rowe <hello@jonrowe.co.uk>2013-04-11 17:21:55 +1000
committerJon Rowe <hello@jonrowe.co.uk>2013-04-11 17:26:07 +1000
commit81367e66224e9fd0af4752f67583460df6422369 (patch)
tree24e03106a1bb376629692d79ba4d419e4b390c3c /spec
parent498a97c9089ea377d85f03470ecef1c1a5c6330a (diff)
downloaddiff-lcs-81367e66224e9fd0af4752f67583460df6422369.tar.gz
protect against no data
Diffstat (limited to 'spec')
-rw-r--r--spec/hunk_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/hunk_spec.rb b/spec/hunk_spec.rb
index 0741b87..282946b 100644
--- a/spec/hunk_spec.rb
+++ b/spec/hunk_spec.rb
@@ -59,5 +59,19 @@ Tu avec carte {count} item has
EOD
expect(hunk.diff(:reverse_ed).to_s == expected).to eql true
end
+
+ context 'with empty first data set' do
+ let(:old_data) { [] }
+
+ it 'should be able to produce a unified diff' do
+ expected =
+(<<-EOD.encode('UTF-16LE').chomp)
+@@ -1 +1,2 @@
++Tu avec carte {count} item has
+EOD
+ expect(hunk.diff(:unified).to_s == expected).to eql true
+ end
+ end
+
end
end