Permalink
Browse files

Added a step to check file content partially.

  • Loading branch information...
1 parent 160e919 commit f16b12e4031cdff7f6b16031b7d17ec5582576a0 @yuya-takeyama yuya-takeyama committed Jan 1, 2012
Showing with 18 additions and 0 deletions.
  1. +14 −0 features/file_system_commands.feature
  2. +4 −0 lib/aruba/cucumber.rb
View
14 features/file_system_commands.feature
@@ -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:
"""
View
4 lib/aruba/cucumber.rb
@@ -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

0 comments on commit f16b12e

Please sign in to comment.