summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAustin Ziegler <austin@surfeasy.com>2013-01-20 03:04:45 -0500
committerAustin Ziegler <austin@surfeasy.com>2013-01-20 03:04:45 -0500
commite6bb3325fbddb66b967ea2fb0cdb6ee7380784b9 (patch)
tree9bcbe07ff7cc4c863780e5f2ff299e0342b8d8f4 /spec
parent2513a70c99560e3d4cd218d442044ddaf86e6f61 (diff)
downloaddiff-lcs-e6bb3325fbddb66b967ea2fb0cdb6ee7380784b9.tar.gz
Fixed Issue #1 patch direction detection.
This bug has been filed for five and a half years and I have finally fixed it. By ghu it feels good.
Diffstat (limited to 'spec')
-rw-r--r--spec/issues_spec.rb5
-rw-r--r--spec/patch_spec.rb25
2 files changed, 17 insertions, 13 deletions
diff --git a/spec/issues_spec.rb b/spec/issues_spec.rb
index 1b12825..c3d8f87 100644
--- a/spec/issues_spec.rb
+++ b/spec/issues_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe "Diff::LCS Issues" do
include Diff::LCS::SpecHelper::Matchers
- it "should not fail to provide a simple patchset (issue 1)", :broken => true do
+ it "should not fail to provide a simple patchset (issue 1)" do
s1, s2 = *%W(aX bXaX)
correct_forward_diff = [
[ [ '+', 0, 'b' ],
@@ -17,5 +17,8 @@ describe "Diff::LCS Issues" do
expect do
Diff::LCS.patch(s1, diff_s1_s2).should == s2
end.to_not raise_error(RuntimeError, /provided patchset/)
+ expect do
+ Diff::LCS.patch(s2, diff_s1_s2).should == s1
+ end.to_not raise_error(RuntimeError, /provided patchset/)
end
end
diff --git a/spec/patch_spec.rb b/spec/patch_spec.rb
index 7172aea..83d2c31 100644
--- a/spec/patch_spec.rb
+++ b/spec/patch_spec.rb
@@ -189,13 +189,13 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
@@ -227,13 +227,13 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
@@ -265,13 +265,13 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::SDiffCallbacks)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
@@ -303,13 +303,13 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
@@ -341,13 +341,13 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
@@ -379,13 +379,14 @@ describe "Diff::LCS.patch" do
@patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::DiffCallbacks)
end
- it "should autodiscover s1 to s2 patches", :broken => true do
+ it "should autodiscover s1 to s2 patches" do
expect do
Diff::LCS.patch(@s1, @patch_set_s1_s2).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)
end
- it "should autodiscover s2 to s1 patches", :broken => true do
+ it "should autodiscover s2 to s1 patches" do
+p @s2, @s1, @patch_set_s2_s1
expect do
Diff::LCS.patch(@s1, @patch_set_s2_s1).should == @s2
end.to_not raise_error(RuntimeError, /provided patchset/)