Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The file should contain "regex" #9

Closed
bryan-ash opened this issue May 14, 2010 · 2 comments
Closed

The file should contain "regex" #9

bryan-ash opened this issue May 14, 2010 · 2 comments

Comments

@bryan-ash
Copy link

There's a good chance that I'm being dense, but the file content matching regular expression steps don't work.

For example:
Scenario: Example
Given a file named "output.txt" with:
"""
1111111
"""
Then the file "output.txt" should contain "1+"

Fails:
Then the file "output.txt" should contain "1+" # 1.8.6-p399/gems/aruba-0.1.9/lib/aruba/cucumber.rb:145
expected "1111111" to match /1+/ (Spec::Expectations::ExpectationNotMetError)
features/counter.feature:25:in `Then the file "output.txt" should contain "1+"'

If I want to match a regular expression, why would I want Aruba to escape the expression I provide?

Would you expect the following scenario to pass?
Scenario: Check file contents
Given a file named "foo" with:
"""
hello world
"""
Then the file "foo" should contain "h.llo world"
And the file "foo" should not contain "HELLO WORLD"

@aslakhellesoy
Copy link
Contributor

Added step definitions for comparing file contents with regexps. Closed by 0596aa6.

@bryan-ash
Copy link
Author

Great addition. Thank you Aslak!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants