Yes, editor and core use two different parsers.
We can align the two. We can support no space after the comment.
Please raise a JIRA for this.
On 14/05/2014 09:10, Hans Schwäbli wrote:
I will do that, thank you.
The story editor displays that line as a comment line, painting it
green. It does not require a space after !-- for the story editor to
detect it as a comment line. It is the same with some other keywords
in the story editor, for example I can start a line with
Scenario:blabla and the story editor recognizes it as a scenario.
Usually comment keywords don't include a space (XML, SQL, Javadoc
etc.) So it is contra intuitive in a way.
It is contra intuitive because of that and because the story editor
recognizes some of the keywords without having to add a space, but the
execution does not recognize them as such.
Does that make sense?
2014-05-13 19:43 GMT+02:00 Mauro Talevi <[email protected]
<mailto:[email protected]>>:
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.