Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Scenario| reported as multiline string #356

os97673 opened this Issue · 8 comments

5 participants

Oleg Sukhodolsky Steve Tooke Matt Wynne Karl Krukow Chris Parsons
Oleg Sukhodolsky

as was discussed at mailing list ( cucumber has bug with Senario| (which is declared in Cucumber::Ast::Names (
If we have scenario:
Scenario: line1.
Given a
And b
Then c
And having before hook:
Before do |scenario|
p []
The hook prints name as "line1.\nline2." While scenario name must be one line string.

Steve Tooke

I've just taken a quick look at this.

The Names module is included in the following classes.

  • Background
  • Examples
  • Feature
  • Scenario
  • ScenarioOutline

Currently each of these classes has a @title and @description, and including Names adds readers for those, plus a #name method, which concats them.

Does gherkin define them as name and description for all these elements?

Oleg Sukhodolsky

@tooky from the discussion we had on the mailing list I've got an impression that there is no name property in Gherkin, only title and description.
@mattwynne @aslakhellesoy am I right?

Matt Wynne

Formally, it goes like this:

Feature: <name>

So the code in Cucumber is wrong. It's really wrong actually. IIRC it has the following wrong:

  • it uses #title for what's called name in Gherkin
  • it uses #name for some made-up thing that wraps both name and description from Gherkin

We should get rid of #title altogether, and change #name to return the name from Gherkin.

However we need to be aware that this is changing the API. People like Calabash and Jetbrains particularly will care about this.

cc @krukow

Oleg Sukhodolsky

Perhaps we could just change #name in 1.3.0 and remove title in 2.0. What do you think?

Steve Tooke
Karl Krukow

Thanks for the notification. We would prefer breaking changes deferred to 2.0. We have custom reporters that depend on the semantics.

Oleg Sukhodolsky

I've moved the ticket to 2.0

Chris Parsons chrismdp modified the milestone: 2.0
Matt Wynne

#name for 2.0 will return the name of the underlying Cucumber::Core::Test::Case which will always be a one-line string.

Matt Wynne mattwynne closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.