Class: Cucumber::StepMatchSearch::AssertUnambiguousMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/step_match_search.rb

Instance Method Summary collapse

Constructor Details

#initialize(search, configuration) ⇒ AssertUnambiguousMatch

Returns a new instance of AssertUnambiguousMatch


15
16
17
# File 'lib/cucumber/step_match_search.rb', line 15

def initialize(search, configuration)
  @search, @configuration = search, configuration
end

Instance Method Details

#call(step_name) ⇒ Object


19
20
21
22
23
# File 'lib/cucumber/step_match_search.rb', line 19

def call(step_name)
  result = @search.call(step_name)
  raise Cucumber::Ambiguous.new(step_name, result, @configuration.guess?) if result.length > 1
  result
end