diff options
author | Jon Rowe <hello@jonrowe.co.uk> | 2013-04-11 17:21:55 +1000 |
---|---|---|
committer | Jon Rowe <hello@jonrowe.co.uk> | 2013-04-11 17:26:07 +1000 |
commit | 81367e66224e9fd0af4752f67583460df6422369 (patch) | |
tree | 24e03106a1bb376629692d79ba4d419e4b390c3c /spec | |
parent | 498a97c9089ea377d85f03470ecef1c1a5c6330a (diff) | |
download | diff-lcs-81367e66224e9fd0af4752f67583460df6422369.tar.gz |
protect against no data
Diffstat (limited to 'spec')
-rw-r--r-- | spec/hunk_spec.rb | 14 |
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 |