summaryrefslogtreecommitdiff
path: root/spec/diff_spec.rb
diff options
context:
space:
mode:
authorAustin Ziegler <austin@surfeasy.com>2012-03-21 02:27:56 -0400
committerAustin Ziegler <austin@surfeasy.com>2012-03-21 02:36:24 -0400
commita341ac7ca261a73e37c21a7f034f5892ea7dcde4 (patch)
tree0c695c928eceb5752a554a9dd483d3e141af624d /spec/diff_spec.rb
parent86e4e1ba222cab4dddf13caa5c56925c9a6401dc (diff)
downloaddiff-lcs-a341ac7ca261a73e37c21a7f034f5892ea7dcde4.tar.gz
Major investigation to Diff::LCS bugs.
- Fixed some formatting and style issues. - Trailing spaces - Calling class methods using '.' instead of '::'. - Resolved Issue #2 by handling string[string.size, 1] properly (it returns "" not nil). - Added special case handling for Diff::LCS.patch so that it handles patches that are empty or contain no changes. - Adding temporary code to help determined the reason for the misidentification of patch direction. - Added a number of different specs to check for comparing the same value. - Added broken spec filtering.
Diffstat (limited to 'spec/diff_spec.rb')
-rw-r--r--spec/diff_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/diff_spec.rb b/spec/diff_spec.rb
index d2c78a2..81f20bb 100644
--- a/spec/diff_spec.rb
+++ b/spec/diff_spec.rb
@@ -30,6 +30,14 @@ describe "Diff::LCS.diff" do
correct_diff.each { |hunk| hunk.each { |change| change[0] = '+' } }
change_diff(correct_diff).should == diff
end
+
+ it "should return an empty diff with (hello, hello)" do
+ Diff::LCS.diff(hello, hello).should == []
+ end
+
+ it "should return an empty diff with (hello_ary, hello_ary)" do
+ Diff::LCS.diff(hello_ary, hello_ary).should == []
+ end
end
# vim: ft=ruby