Class: Cucumber::Formatter::Query::PickleStepByTestStep

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/pickle_step_by_test_step.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ PickleStepByTestStep

Returns a new instance of PickleStepByTestStep.



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

def initialize(config)
  @pickle_id_step_by_test_step_id = {}
  config.on_event :test_step_created, &method(:on_test_step_created)
end

Instance Method Details

#pickle_step_id(test_step) ⇒ Object



12
13
14
15
16
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/formatter/query/pickle_step_by_test_step.rb', line 12

def pickle_step_id(test_step)
  return @pickle_id_step_by_test_step_id[test_step.id] if @pickle_id_step_by_test_step_id.key?(test_step.id)

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