summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAustin Ziegler <austin@surfeasy.com>2012-03-24 00:35:04 -0400
committerAustin Ziegler <austin@surfeasy.com>2012-03-24 00:42:25 -0400
commit2151e2093dfd00d6aff72f49d13a137efeed2e53 (patch)
treea54fba041abf07cfe1c43c0652efc7c34b153eb9 /spec
parenta341ac7ca261a73e37c21a7f034f5892ea7dcde4 (diff)
downloaddiff-lcs-2151e2093dfd00d6aff72f49d13a137efeed2e53.tar.gz
Starting on a substantial refactoring to fix bugs.
1. All Diff::LCS::__* methods are now moved to Diff::LCS::Internals and named without the underscores. 2. Fixed the documentation for Diff::LCS::patch. (Some formatting may have been broken.) 3. Eliminated normalize_patchset in favour of the (substantially similar) analyze_patchset. This allows for a single-pass over a patchset to determine whether the patchset contains changes and transform it to the object-based format. 4. Made Diff::LCS::ContextChange descend from Diff::LCS::Change. This will probably change so that both descend from something like a Diff::LCS::AbstractChange because of some issues that may arise with case statement order.
Diffstat (limited to 'spec')
-rw-r--r--spec/lcs_spec.rb8
-rw-r--r--spec/patch_spec.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/spec/lcs_spec.rb b/spec/lcs_spec.rb
index 0fc077e..addc2f7 100644
--- a/spec/lcs_spec.rb
+++ b/spec/lcs_spec.rb
@@ -2,11 +2,11 @@
require 'spec_helper'
-describe "Diff::LCS.__lcs" do
+describe "Diff::LCS::Internals.lcs" do
include Diff::LCS::SpecHelper::Matchers
it "should return a meaningful LCS array with (seq1, seq2)" do
- res = Diff::LCS.__lcs(seq1, seq2)
+ res = Diff::LCS::Internals.lcs(seq1, seq2)
# The result of the LCS (less the +nil+ values) must be as long as the
# correct result.
res.compact.size.should == correct_lcs.size
@@ -21,11 +21,11 @@ describe "Diff::LCS.__lcs" do
end
it "should return all indexes with (hello, hello)" do
- Diff::LCS.__lcs(hello, hello).should == (0...hello.size).to_a
+ Diff::LCS::Internals.lcs(hello, hello).should == (0...hello.size).to_a
end
it "should return all indexes with (hello_ary, hello_ary)" do
- Diff::LCS.__lcs(hello_ary, hello_ary).should == (0...hello_ary.size).to_a
+ Diff::LCS::Internals.lcs(hello_ary, hello_ary).should == (0...hello_ary.size).to_a
end
end
diff --git a/spec/patch_spec.rb b/spec/patch_spec.rb
index ad160c9..72bfe85 100644
--- a/spec/patch_spec.rb
+++ b/spec/patch_spec.rb
@@ -320,7 +320,7 @@ describe "Diff::LCS.patch" do
Diff::LCS.patch(@s2, @patch_set_s1_s2).should == @s1
end
- it "should correctly patch left-to-right (explicit patch)" do
+ it "should correctly patch left-to-right (explicit patch)", :only => true do
Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch).should == @s2
Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch).should == @s1
Diff::LCS.patch!(@s1, @patch_set_s1_s2).should == @s2