Skip to content

Commit

Permalink
Added /^the stderr should contain exactly:"$/ and /^the stdout should…
Browse files Browse the repository at this point in the history
… contain exactly:"$/
  • Loading branch information
aslakhellesoy committed Nov 7, 2010
1 parent f36dfe2 commit 1cca0f2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions History.txt
@@ -1,6 +1,8 @@
== In Git

=== New Features
* Added /^the stderr should contain exactly:"$/ (Aslak Hellesøy)
* Added /^the stdout should contain exactly:"$/ (Aslak Hellesøy)
* Added /it should pass with exactly:/ (Aslak Hellesøy)

== 0.2.4
Expand Down
9 changes: 9 additions & 0 deletions features/output.feature
Expand Up @@ -92,6 +92,15 @@ Feature: Output
hello
"""

Scenario: Match failing exit status and exact output
When I run "ruby -e 'puts \"hello\\nworld\";exit 99'"
Then it should fail with exactly:
"""
hello
world
"""

@announce-stdout
Scenario: Match failing exit status and output with regex
When I run "ruby -e 'puts \"hello\\nworld\";exit 99'"
Expand Down
8 changes: 8 additions & 0 deletions lib/aruba/cucumber.rb
Expand Up @@ -172,10 +172,18 @@
@last_stderr.should =~ regexp(partial_output)
end

Then /^the stderr should contain exactly:$/ do |exact_output|
@last_stderr.should == exact_output
end

Then /^the stdout should contain "([^"]*)"$/ do |partial_output|
@last_stdout.should =~ regexp(partial_output)
end

Then /^the stdout should contain exactly:$/ do |exact_output|
@stdout.should == exact_output
end

Then /^the stderr should not contain "([^"]*)"$/ do |partial_output|
@last_stderr.should_not =~ regexp(partial_output)
end
Expand Down

0 comments on commit 1cca0f2

Please sign in to comment.