Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid hardcoded newline tests #72

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/helper.rb
Expand Up @@ -81,6 +81,10 @@ def ignore_deprecations
Rake.application.options.ignore_deprecate = false Rake.application.options.ignore_deprecate = false
end end


def new_line
Rake.application.windows? ? "\r\n" : "\n"
end

def rake_system_dir def rake_system_dir
@system_dir = 'system' @system_dir = 'system'


Expand Down
4 changes: 2 additions & 2 deletions test/test_rake_file_list.rb
Expand Up @@ -342,7 +342,7 @@ def test_egrep_with_output
files.egrep(/XYZZY/) files.egrep(/XYZZY/)
end end


assert_equal "xyzzy.txt:2:XYZZY\n", out assert_equal "xyzzy.txt:2:XYZZY#{new_line}", out
end end


def test_egrep_with_block def test_egrep_with_block
Expand All @@ -353,7 +353,7 @@ def test_egrep_with_block
found = [fn, ln, line] found = [fn, ln, line]
end end


assert_equal ["xyzzy.txt", 2, "XYZZY\n"], found assert_equal ["xyzzy.txt", 2, "XYZZY#{new_line}"], found
end end


def test_egrep_with_error def test_egrep_with_error
Expand Down