Class: Cucumber::Formatter::Query::StepDefinitionsByTestStep

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/formatter/query/step_definitions_by_test_step.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ StepDefinitionsByTestStep

Returns a new instance of StepDefinitionsByTestStep.



7
8
9
10
11
12
13
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/formatter/query/step_definitions_by_test_step.rb', line 7

def initialize(config)
  @step_definition_ids_by_test_step_id = {}
  @step_match_arguments_by_test_step_id = {}

  config.on_event :test_step_created, &method(:on_test_step_created)
  config.on_event :step_activated, &method(:on_step_activated)
end

Instance Method Details

#step_definition_ids(test_step) ⇒ Object



15
16
17
18
19
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/formatter/query/step_definitions_by_test_step.rb', line 15

def step_definition_ids(test_step)
  return @step_definition_ids_by_test_step_id[test_step.id] if @step_definition_ids_by_test_step_id.key?(test_step.id)

  raise TestStepUnknownError, "No step definition found for #{test_step.id} }. Known: #{@step_definition_ids_by_test_step_id.keys}"
end

#step_match_arguments(test_step) ⇒ Object



21
22
23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/formatter/query/step_definitions_by_test_step.rb', line 21

def step_match_arguments(test_step)
  return @step_match_arguments_by_test_step_id[test_step.id] if @step_match_arguments_by_test_step_id.key?(test_step.id)

  raise TestStepUnknownError, "No step match arguments found for #{test_step.id} }. Known: #{@step_match_arguments_by_test_step_id.keys}"
end