Exception: Cucumber::CucumberExpressions::AlternationNotAllowedInOptional

Inherits:
CucumberExpressionError show all
Defined in:
lib/cucumber/cucumber_expressions/errors.rb

Instance Method Summary collapse

Methods inherited from CucumberExpressionError

#build_message, #point_at, #point_at_located

Constructor Details

#initialize(expression, current) ⇒ AlternationNotAllowedInOptional

Returns a new instance of AlternationNotAllowedInOptional.



154
155
156
157
158
159
160
161
162
163
164
# File 'lib/cucumber/cucumber_expressions/errors.rb', line 154

def initialize(expression, current)
  super(
    build_message(
      current.start,
      expression,
      point_at_located(current),
      'An alternation can not be used inside an optional',
      "If you did not mean to use an alternation you can use '\\/' to escape the '/'. Otherwise rephrase your expression or consider using a regular expression instead."
    )
  )
end