Class: Cucumber::Runtime::SupportCode

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber_priority/resolve_ambiguous_error.rb,
lib/cucumber_priority/resolve_ambiguous_error.rb

Instance Method Summary collapse

Instance Method Details

#step_match_with_priority(*args) ⇒ Object

Cucumber 2.1 or lower has a single method #step_match which returns a single Cucumber::StepMatch. This method raises Cucumber::Ambigiuous if there are two or more matches.



91
92
93
94
95
# File 'lib/cucumber_priority/resolve_ambiguous_error.rb', line 91

def step_match_with_priority(*args)
  step_match_without_priority(*args)
rescue Ambiguous => e
  CucumberPriority::Resolver.resolve_ambiguity_through_priority(e)
end

#step_matches(*args) ⇒ Object

This method doesn’t exist in old Cucumbers. We define it so our specs have a unified API to match steps.



101
102
103
# File 'lib/cucumber_priority/resolve_ambiguous_error.rb', line 101

def step_matches(*args)
  [step_match(*args)]
end

#step_matches_with_priority(*args) ⇒ Object



56
57
58
59
60
# File 'lib/cucumber_priority/resolve_ambiguous_error.rb', line 56

def step_matches_with_priority(*args)
  step_matches_without_priority(*args)
rescue Ambiguous => e
  [CucumberPriority::Resolver.resolve_ambiguity_through_priority(e)]
end