Avoid hardcoded newline tests #72

Closed
wants to merge 1 commit into
from
View
4 test/helper.rb
@@ -81,6 +81,10 @@ def ignore_deprecations
Rake.application.options.ignore_deprecate = false
end
+ def new_line
+ Rake.application.windows? ? "\r\n" : "\n"
+ end
+
def rake_system_dir
@system_dir = 'system'
View
4 test/test_rake_file_list.rb
@@ -342,7 +342,7 @@ def test_egrep_with_output
files.egrep(/XYZZY/)
end
- assert_equal "xyzzy.txt:2:XYZZY\n", out
+ assert_equal "xyzzy.txt:2:XYZZY#{new_line}", out
end
def test_egrep_with_block
@@ -353,7 +353,7 @@ def test_egrep_with_block
found = [fn, ln, line]
end
- assert_equal ["xyzzy.txt", 2, "XYZZY\n"], found
+ assert_equal ["xyzzy.txt", 2, "XYZZY#{new_line}"], found
end
def test_egrep_with_error