Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/rspec/support/spec/diff_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ module DiffHelpers
def one_line_header(line_number=2)
"-1,#{line_number} +1,#{line_number}"
end

def removing_two_line_header
"-1,3 +1"
end
else
def one_line_header(_=2)
"-1 +1"
end
end

if Diff::LCS::VERSION.to_f < 1.4 || Diff::LCS::VERSION >= "1.4.4"
def removing_two_line_header
"-1,3 +1"
end
else
def removing_two_line_header
"-1,3 +1,5"
end
Expand Down
6 changes: 3 additions & 3 deletions spec/rspec/support/differ_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module Support
expected = "foo\nzap\nbar\nthis\nis\nsoo\nvery\nvery\nequal\ninsert\na\nanother\nline\n"
actual = "foo\nbar\nzap\nthis\nis\nsoo\nvery\nvery\nequal\ninsert\na\nline\n"

if Diff::LCS::VERSION.to_f < 1.4
if Diff::LCS::VERSION.to_f < 1.4 || Diff::LCS::VERSION >= "1.4.4"
expected_diff = dedent(<<-'EOD')
|
|
Expand All @@ -40,7 +40,7 @@ module Support
expected_diff = dedent(<<-'EOD')
|
|
|@@ -1,4 +1,6 @@
|@@ -1,6 +1,6 @@
| foo
|-zap
| bar
Expand All @@ -65,7 +65,7 @@ module Support
expected = "foo\nzap\nbar\nthis\nis\nsoo\nvery\nvery\nequal\ninsert\na\nanother\nline\n"
actual = "foo\nbar\nzap\nthis\nis\nsoo\nvery\nvery\nequal\ninsert\na\nline\n"

if Diff::LCS::VERSION.to_f < 1.4
if Diff::LCS::VERSION.to_f < 1.4 || Diff::LCS::VERSION >= "1.4.4"
expected_diff = dedent(<<-'EOS')
|
|
Expand Down