Class: Cucumber::Repository

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

Overview

In memory repository i.e. a thread based link to cucumber-query

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

Returns a new instance of Repository.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cucumber/repository.rb', line 17

def initialize
  @attachments_by_test_case_started_id = _hash_with_array_default
  @attachments_by_test_run_hook_started_id = _hash_with_array_default
  @hook_by_id = {}
  @pickle_by_id = {}
  @pickle_step_by_id = {}
  @step_by_id = {}
  @step_definition_by_id = {}
  @suggestions_by_pickle_step_id = _hash_with_array_default
  @test_case_by_id = {}
  @test_case_started_by_id = {}
  @test_case_finished_by_test_case_started_id = {}
  @test_run_hook_started_by_id = {}
  @test_run_hook_finished_by_test_run_hook_started_id = {}
  @test_step_by_id = {}
  @test_steps_started_by_test_case_started_id = _hash_with_array_default
  @test_steps_finished_by_test_case_started_id = _hash_with_array_default
  @undefined_parameter_types = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (private)



45
46
47
48
49
50
51
52
53
# File 'lib/cucumber/repository.rb', line 45

def method_missing(method_name, *args, &)
  if method_name.to_s.start_with?('update_')
    Kernel.warn("Attempting to update the repository with #{method_name}. Please raise this as a missing message handler")
    Kernel.warn('Create an issue here: https://github.com/cucumber/query/issues')
    nil
  else
    super
  end
end

Instance Attribute Details

#attachments_by_test_case_started_idObject (readonly)

Returns the value of attribute attachments_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def attachments_by_test_case_started_id
  @attachments_by_test_case_started_id
end

#attachments_by_test_run_hook_started_idObject (readonly)

Returns the value of attribute attachments_by_test_run_hook_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def attachments_by_test_run_hook_started_id
  @attachments_by_test_run_hook_started_id
end

#hook_by_idObject (readonly)

Returns the value of attribute hook_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def hook_by_id
  @hook_by_id
end

#metaObject

Returns the value of attribute meta.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def meta
  @meta
end

#pickle_by_idObject (readonly)

Returns the value of attribute pickle_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def pickle_by_id
  @pickle_by_id
end

#pickle_step_by_idObject (readonly)

Returns the value of attribute pickle_step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def pickle_step_by_id
  @pickle_step_by_id
end

#step_by_idObject (readonly)

Returns the value of attribute step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def step_by_id
  @step_by_id
end

#step_definition_by_idObject (readonly)

Returns the value of attribute step_definition_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def step_definition_by_id
  @step_definition_by_id
end

#suggestions_by_pickle_step_idObject (readonly)

Returns the value of attribute suggestions_by_pickle_step_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def suggestions_by_pickle_step_id
  @suggestions_by_pickle_step_id
end

#test_case_by_idObject (readonly)

Returns the value of attribute test_case_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_by_id
  @test_case_by_id
end

#test_case_finished_by_test_case_started_idObject (readonly)

Returns the value of attribute test_case_finished_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_finished_by_test_case_started_id
  @test_case_finished_by_test_case_started_id
end

#test_case_started_by_idObject (readonly)

Returns the value of attribute test_case_started_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_started_by_id
  @test_case_started_by_id
end

#test_run_finishedObject

Returns the value of attribute test_run_finished.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def test_run_finished
  @test_run_finished
end

#test_run_hook_finished_by_test_run_hook_started_idObject (readonly)

Returns the value of attribute test_run_hook_finished_by_test_run_hook_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_run_hook_finished_by_test_run_hook_started_id
  @test_run_hook_finished_by_test_run_hook_started_id
end

#test_run_hook_started_by_idObject (readonly)

Returns the value of attribute test_run_hook_started_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_run_hook_started_by_id
  @test_run_hook_started_by_id
end

#test_run_startedObject

Returns the value of attribute test_run_started.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def test_run_started
  @test_run_started
end

#test_step_by_idObject (readonly)

Returns the value of attribute test_step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_step_by_id
  @test_step_by_id
end

#test_steps_finished_by_test_case_started_idObject (readonly)

Returns the value of attribute test_steps_finished_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_steps_finished_by_test_case_started_id
  @test_steps_finished_by_test_case_started_id
end

#test_steps_started_by_test_case_started_idObject (readonly)

Returns the value of attribute test_steps_started_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_steps_started_by_test_case_started_id
  @test_steps_started_by_test_case_started_id
end

#undefined_parameter_typesObject (readonly)

Returns the value of attribute undefined_parameter_types.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def undefined_parameter_types
  @undefined_parameter_types
end

Instance Method Details

#update(envelope) ⇒ Object



37
38
39
40
41
# File 'lib/cucumber/repository.rb', line 37

def update(envelope)
  message_category = envelope.type[:contained_message]
  message_value = envelope.public_send(message_category)
  send("update_#{message_category}", message_value)
end