Permalink
Browse files

Regexp.compile

  • Loading branch information...
1 parent 09d3e4c commit ed4defb4bfcd0a0073b80f8129cd3892d0a71ce6 @dchelimsky dchelimsky committed Oct 5, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 features/step_definitions/additional_cli_steps.rb
@@ -1,6 +1,6 @@
# Useful for when the output is slightly different on different versions of ruby
Then /^the output should contain "([^"]*)" or "([^"]*)"$/ do |string1, string2|
- unless [string1, string2].any? { |s| combined_output =~ regexp(s) }
+ unless [string1, string2].any? { |s| combined_output =~ Regexp.compile(s) }
fail %Q{Neither "#{string1}" or "#{string2}" were found in:\n#{combined_output}}
end
end

2 comments on commit ed4defb

@myronmarston
Member

Hmm...looks like the regexp method from aruba that I was calling already handles the Regexp.compile (along with escaping):

http://github.com/aslakhellesoy/aruba/blob/v0.2.3/lib/aruba/api.rb#L95-97

@dchelimsky
Member

I'm using an older version of aruba due to a bug in cucumber 0.9.0. That bug is fixed in git, but I'll wait for the cuke release before updating aruba and cukes in this repo.

Please sign in to comment.