cucumber/aruba — Issue #97: Executing invalid command may result in false positives
Author: thedjinn
Created: 2011-12-10 12:55:19+00:00
State: open

Consider the following example:

~~~ gherkin
Feature: Bad exec error handling

Scenario: False positive
When I run `thiscommanddoesnotexist`
Then the output should contain "thiscommanddoesnotexist"

Scenario: Example showing internal backtrace as command output in assertion error
When I run `thiscommanddoesnotexist`
Then the output should contain exactly ""
~~~

The executable that we are running does not exist, so whenever Ruby executes this command it will fail with `ENOENT`. However, the output (stderr) of this invocation is a backtrace that is internal to Cucumber creating a possibility for false positives.

My suggestion is to check if executing the child process command results in an exception and to raise that exception on the "When" step instead of silently continuing.