Class: Cucumber::Undefined

Inherits:
Core::Test::Result::Undefined
  • Object
show all
Defined in:
lib/cucumber/errors.rb

Overview

Raised when there is no matching StepDefinition for a step.

Class Method Summary collapse

Class Method Details

.from(result, step_name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cucumber/errors.rb', line 8

def self.from(result, step_name)
  if result.is_a?(self)
    return result.with_message(with_prefix(result.message))
  end

  begin
    raise self.new(with_prefix(step_name))
  rescue => exception
    return exception
  end
end

.with_prefix(step_name) ⇒ Object



20
21
22
# File 'lib/cucumber/errors.rb', line 20

def self.with_prefix(step_name)
  %(Undefined step: "#{step_name}")
end