I ran the following story without any Steps implementation:
Feature: Login
Narrative:
In order to use the system, one needs to login and identify herself
to the system
Scenario: Login page
When user browses to http:Then the login page appears
I had configured the runner to complain about the non-existing implementations:
embedder.configuration().usePendingStepStrategy(new FailingUponPendingStep());
Expected behaviour: build should fail with that configuration
Actual behaviour: it always succeeded
JBehave version: jbehave-ant 3.9.4
More details:
I did not get any failures, so I started debugging JBehave. When tracing, sometimes I got the error, so I guessed it was a timing issue. Debugging more and I came into the place I pasted above. Then I used the 3.9.3 version and the build always failed with that version, as expected.
I tracked down the problem and it resides in jbehave-core/src/main/java/org/jbehave/core/embedder/StoryManager.java:
In the above code, the if ( runningStory.isStarted() ){ does not have any else, so if the stories have not yet started, allDone is left true and JBehave exits without waiting for the stories to finish running.