lib/testr/config.rb in testr-14.0.0 vs lib/testr/config.rb in testr-14.0.1
- old
+ new
@@ -44,16 +44,16 @@
Config.after_fork_hooks = [
# tell testing framework to only run the named tests inside the test file
lambda do |worker_number, log_file, test_file, test_names|
unless test_names.empty?
- regexp = Regexp.union(test_names.map {|name|
+ regexp = test_names.map {|name|
# sanitize string interpolations and invalid method name characters
name.gsub(/\#\{.*?\}/, ' ').strip.gsub(/\W+/, '.*')
- })
+ }.join('|')
case File.basename(test_file)
- when /(\b|_)test(\b|_)/ then ARGV.push '--name', regexp.inspect
+ when /(\b|_)test(\b|_)/ then ARGV.push '--name', "/#{regexp}/"
when /(\b|_)spec(\b|_)/ then ARGV.push '--example', regexp.source
end
end
end
]