Exception: Cucumber::CucumberExpressions::CucumberExpressionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/errors.rb

Instance Method Summary collapse

Instance Method Details

#build_message(index, expression, pointer, problem, solution) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/errors.rb', line 7

def build_message(
    index,
    expression,
    pointer,
    problem,
    solution
)
  m = <<-EOF
This Cucumber Expression has a problem at column #{index + 1}:

#{expression}
#{pointer}
#{problem}.
#{solution}
  EOF
  m.strip
end

#point_at(index) ⇒ Object



25
26
27
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/errors.rb', line 25

def point_at(index)
  ' ' * index + '^'
end

#point_at_located(node) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-cucumber-expressions-15.2.0/lib/cucumber/cucumber_expressions/errors.rb', line 29

def point_at_located(node)
  pointer = [point_at(node.start)]
  if node.start + 1 < node.end
    for _ in node.start + 1...node.end - 1
      pointer.push('-')
    end
    pointer.push('^')
  end
  pointer.join('')
end