Class: Cucumber::Filters::ActivateSteps::CaseFilter::FindMatch

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

Instance Method Summary collapse

Constructor Details

#initialize(step_match_search, configuration, test_step) ⇒ FindMatch

Returns a new instance of FindMatch.



44
45
46
47
48
# File 'lib/cucumber/filters/activate_steps.rb', line 44

def initialize(step_match_search, configuration, test_step)
  @step_match_search = step_match_search
  @configuration = configuration
  @test_step = test_step
end

Instance Method Details

#resultObject



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/cucumber/filters/activate_steps.rb', line 50

def result
  begin
    return NoStepMatch.new(test_step, test_step.text) unless matches.any?
  rescue Cucumber::Ambiguous => e
    return AmbiguousStepMatch.new(e)
  end
  configuration.notify :step_activated, test_step, match
  return SkippingStepMatch.new if configuration.dry_run?

  match
end