Step definition to check file content partially #103

Merged
merged 1 commit into from Jan 4, 2012
@@ -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:
"""
@@ -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