concordion / idea-concordion-support

Concordion support IntelliJ Idea plugin https://plugins.jetbrains.com/plugin/7978
Other
13 stars 8 forks source link

example command missing equals in table #21

Open dingfelder opened 5 years ago

dingfelder commented 5 years ago

if you use the example command in the header of a table within markdown e.g | [run][] [Scenario](- "c:example") | [secondColumn]...

The Intellij IDE is complaining of an error: Error:(17, 34) '=' expected - this position refers to the closing doublequote after example

Looking at the docs, I see the following code <div concordion:example="example2"> but that's for html, not markdown. (all the markdown examples I see just say: "c:example")

I tried changing it to: | [run][] [Scenario](- "c:example=compareSQL") | But that doesnt help, when I run that test, I get the following exception Specification has duplicate example: 'compareSQL'

java.lang.Exception: Specification has duplicate example: 'compareSQL'
    at org.junit.runners.model.InitializationError.<init>(InitializationError.java:38)
    at org.concordion.integration.junit4.ConcordionRunner.verifyUniqueExampleMethods(ConcordionRunner.java:100)
idegtiarenko commented 5 years ago

Hello,

I believe correct ways to declare example are:

## [FirstExample](- "c:example=FirstExample")
Example with command declared
## [SecondExample](- "SecondExample")
Example without command declared

The second part is related to actual specification execution by concordion, not making syntax highlighting in IDE provided by the plugin. I believe the issue there is that there is another example with same name (compareSQL) defined somewhere on the same specification. Seems like example names should be unique at least across the spec file.

Please let me know if this helps.

nigelcharman commented 5 years ago

Hi Ievgen

I think the issue is that the plugin does not support running each row of a table as an example in Markdown and possibly HTML. Sorry, it looks like this was added in 2.1.0 and we didn't inform you.

The duplicate example would have happened since it would have tried running multiple rows of the table with the same example name. I'd ignore this part of the issue, since Andy was just trying to workaround the issue.

For the correct ways to declare an example in your comment above, there is another shorthand you can use. To get an example name matching the normalised header text, you can just write:

## [Third Example](-)
Example with name matching normalised header text (eg. third-example for this example)