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

Step definition to check file content partially #103

Merged
merged 1 commit into from
Jan 4, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions features/file_system_commands.feature
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ Feature: file system commands
Then the file "foo" should match /hel.o world/
And the file "foo" should not match /HELLO WORLD/

Scenario: Check file contents with docstring
Given a file named "foo" with:
"""
foo
bar
baz
foobar
"""
Then the file "foo" should contain:
"""
bar
baz
"""

Scenario: Remove file
Given a file named "foo" with:
"""
Expand Down
4 changes: 4 additions & 0 deletions lib/aruba/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
check_file_content(file, partial_content, false)
end

Then /^the file "([^"]*)" should contain:$/ do |file, partial_content|
check_file_content(file, partial_content, true)
end

Then /^the file "([^"]*)" should contain exactly:$/ do |file, exact_content|
check_exact_file_content(file, exact_content)
end
Expand Down