Closed eduardomello closed 10 years ago
Two things:
No wait....
It is not enough to only have
And the output from "git checkout some-branch" should contain "Switched to branch 'some-branch'"
That step will only validate.
You must have something like:
When I run "git checkout some-branch"
And the output from "git checkout some-branch" should contain "Switched to branch 'some-branch'"
The first one executes the command, the second one verifies the output.
That should do it...
Please confirm and I will close.
I end up doing
And I run `git checkout some-branch`
And the output should contain "Switched to branch 'some-branch'"
Doesn't it make the
And the output from "[cmd]" should contain "[something]"
kind of useless?
The value of And the output from "[cmd]" should contain "[something]"
is that you can run several independent process in same scenario. Then you can use the above to refer to which process you are validating the output from.
for example:
And I run `git checkout some-branch`
And I run 'printf "hello"`
And the output should contain "Switched to branch 'some-branch'"
Will fail because the last one will compare all output from all the commands, but using And the output from "[cmd]" should contain "[something]"
you can specify which process you compare the output from.
Anyway your report illustrates that the documentation seems insufficient. Thank you.
I just started using cucumber and I have a scenario that is trying to use the
clause like this
When i run the tests I end up receiving this error message:
aruba-0.5.3/lib/aruba/cucumber.rb:101 undefined method
[]' for nil:NilClass (NoMethodError) features/pm_creates_metabranch.feature:21:in
And the output from "git checkout some-branch" should contain "Switched to branch 'some-branch'"'What's wrong here?
Running Ruby 2.0.0-p247