class Cucumber::Formatter::Query::PickleStepByTestStep

Public Class Methods

new(config) click to toggle source
# File 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

Public Instance Methods

pickle_step_id(test_step) click to toggle source
# File 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

Private Instance Methods

on_test_step_created(event) click to toggle source
# File lib/cucumber/formatter/query/pickle_step_by_test_step.rb, line 20
def on_test_step_created(event)
  @pickle_id_step_by_test_step_id[event.test_step.id] = event.pickle_step.id
end