Skip to content

Commit

Permalink
Regexp.compile
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 5, 2010
1 parent 09d3e4c commit ed4defb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/step_definitions/additional_cli_steps.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

2 comments on commit ed4defb

@myronmarston
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.