Skip to content

Commit

Permalink
allow running test files with multiple spaces (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser authored Sep 17, 2021
1 parent f7e7b8d commit 01218db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parallel_tests/test/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_file_name
end

def run_tests(test_files, process_number, num_processes, options)
require_list = test_files.map { |file| file.sub(" ", "\\ ") }.join(" ")
require_list = test_files.map { |file| file.gsub(" ", "\\ ") }.join(" ")
cmd = "#{executable} -Itest -e '%w[#{require_list}].each { |f| require %{./\#{f}} }' -- #{options[:test_options]}"
execute_command(cmd, process_number, num_processes, options)
end
Expand Down
6 changes: 6 additions & 0 deletions spec/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ def test_unicode
)
end

it "can run with uncommon file names" do
skip if RUBY_PLATFORM == "java" # just too slow ...
write "test/long ( stuff ) _test.rb", "puts 'hey'"
expect(run_tests("test", processes: 2)).to include("hey")
end

context "RSpec" do
it_runs_the_default_folder_if_it_exists "rspec", "spec"

Expand Down

0 comments on commit 01218db

Please sign in to comment.