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
18
# File 'lib/cucumber/step_match_search.rb', line 15

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

Instance Method Details

#call(step_name) ⇒ Object



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

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

  result
end