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

Inherits:
Object
  • Object
show all
Defined in:
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.



9
10
11
12
# File 'lib/cucumber/formatter/query/pickle_step_by_test_step.rb', line 9

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



14
15
16
17
18
# File 'lib/cucumber/formatter/query/pickle_step_by_test_step.rb', line 14

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