--bisect's ShellRunner does not properly shellescape special characters
Created by: DavidS
--bisect's ShellRunner does not properly shellescape special characters
when running rspec --bisect
Open3.capture2e
called at
https://github.com/rspec/rspec-core/blob/2800fe118fa2efeb87b7bdc7888476373debf6ca/lib/rspec/core/bisect/shell_runner.rb#L48 will pass the cmd
string through to the system shell without any escaping, leading to spurious failures.
Your environment
- Ruby version: 2.5.5
- rspec-core version: 3.8.0
Steps to reproduce
Execute rspec --bisect --pattern 'spec/**{,/*/**}/*_spec.rb' --exclude-pattern 'spec/{fixtures/**/*.rb,fixtures/modules/*/**/*.rb}'
with active shell backend
Expected behavior
The provided pattern and exclude patterns should be passed through unchanged to the shelled out processes.
Actual behavior
The provided patterns get exposed to the system shell and cause spurious failures. If I puts cmd.inspect
just before L48 (see above) I get this:
"[...] --pattern spec/**{,/*/**}/*_spec.rb --exclude-pattern spec/{fixtures/**/*.rb,fixtures/modules/*/**/*.rb}"
and a lot of failures from the --exclude-pattern being wrong.