--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
On Jan 23, 7:04 pm, Oleg Sukhodolsky <os97...@gmail.com> wrote:In your example above, the scenario's _name_ is line_1. and the
> Hi,
>
> I'm working on RubyMine and RM allows use to run the specific scenario (we
> use --name for this).
> Usually it works well but we have problems with scenarios which have
> multiline name.
> E.g. we have the following scenario:
>
> Scenario: line1.
> line2.
> Given something
> And something else
> Then I've got something new
>
> And we want to execute only this scenario so we're using --name param of
> cucumber's cli
> Now the question: what is the name of the scenario?
>
scenario's _description_ is line2.
Feature/Scenario/Step names are always only one line. It's the text
immediately following the keyword until the end of line.
The --name option only matches against the name (and not the
description) because we thought that would be sufficient at the time.
It would be possible to change this, but it would be a little counter-
intuitive if --name matched against both name and description.
Aslak
> By the output I've got from a regular run it look like the name is a
> multiline name.
> If I've added before hook to print the name
> Before do |scenario|
> p [scenario.name]
> end
> and it prints "line1.\nline2." as the scenario name.
> But if I run "cucumber <feature-file> --name "line1.\nline2."" cucumber
> finds no scenario.
> After some debugging I've found that cucumber converts the string I've
> passed to regexp (which is used by Gherkin::Formatter::RegexpFilter)
> but this filter is matched against first line of a scenario name only. And
> so the correct value for --name should be "line1.".
>
> Is the behavior I see correct or it is a bug? How user is supposed to run
> scenario with multiline name?
>
> Thanks in advance, Oleg.
I may be off here, but my understanding is that the scenario name is just that, a name, and should be short enough to fit on one line. More details, if necessary can go into comments within the scenario.