You need a space after the !-- (the comment keyword is treated like at any other keyword, thus separated by a space from the comment)

On 13/05/2014 13:51, Hans Schwäbli wrote:
In 4.x branch comments doen't seem to be allowed where they used to be allowed in version 3.x. Lets take this example (please ingore German language, it has nothing to do with the problem):
Szenario: Kleine Menge wird bestellt
Gegeben im Lager sind 300 T-Shirts
Wenn ein Kunde 5 T-Shirts bestellt
!--TODO: Gesamtbestellwert könnte auch noch geprüft werden.
Dann ist die Bestellung auf Lager
Und gilt eine Ermässigung von 0 Prozent
Und kostet ein T-Shirt pro Stück 10 Euro
Und betragen die Versandkosten 7,50 Euro
Und ist der Bestellwert 57,50 Euro
That causes this execution failure:
Szenario: Kleine Menge wird bestellt
Gegeben im Lager sind 300 T-Shirts
Wenn ein Kunde 5 T-Shirts bestellt
!--TODO: Gesamtbestellwert könnte auch noch geprüft werden. (AUSSTEHEND)
Dann ist die Bestellung auf Lager (NICHT AUSGEFÜHRT)
Und gilt eine Ermässigung von 0 Prozent (NICHT AUSGEFÜHRT)
Und kostet ein T-Shirt pro Stück 10 Euro (NICHT AUSGEFÜHRT)
Und betragen die Versandkosten 7,50 Euro (NICHT AUSGEFÜHRT)
Und ist der Bestellwert 57,50 Euro (NICHT AUSGEFÜHRT)
@When("ein Kunde 5 T-Shirts bestellt\r\n!--TODO: Gesamtbestellwert k\u00F6nnte auch noch gepr\u00FCft werden.")
@Pending
public void whenEinKunde5TShirtsBestelltTODOGesamtbestellwertKönnteAuchNochGeprüftWerden() {
  // AUSSTEHEND
}
You can reproduce that easily if you place a comment line between steps in a scenario. I suggest that you "pollute" your jbehave-core example stories with comments on all different places (starting with !-- and |-- or even a line including both, be nasty) so that you have a regression test for the story parser concerning comment lines.

Reply via email to