cucumber-query 16.1.1 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0453dc930d89ae052f94e1455d8c7913229df7ba6b79c2b034fd2e065611571
4
- data.tar.gz: baecf3addaa1272b41d6b7e7c2b7e6024a510d6b22f4da345fc72566dbf34a7a
3
+ metadata.gz: 51c0b93ee7360183abbfaba5941c1d9bf1b7c5d607f7b229c9a4b0e2898dbca3
4
+ data.tar.gz: 48af7cae0f78eb0c0d6841da392bceef16cafa92dccc30323869e0c43bebae7c
5
5
  SHA512:
6
- metadata.gz: 642ed3941b5b5d096d8eed1bf54ce888ea7d7f52674069155f45ddbb9b2dabce22a9f365cfd2d46229c01fa3962c112befc0932f4e6d8495a6edfbe27929347e
7
- data.tar.gz: eb51de12f61d54e82224263fdec27b0ab875f1f1808d9e9d8fc1c1f4ea7933135d5f1c467ac04f84e43b409ca2226af615d2eaa5785b8606d9007bd99989fc76
6
+ metadata.gz: c3063ebe2d0963187f4c23e2bb9c333a8a386566635ff25906a9cbd7dc49c6c3cca8ab9201a25e6347b9ff52cf46ec1faec27c630543b629586f1b3e361af60c
7
+ data.tar.gz: c3838de4bb33e8aa3baef2b8ffadd7139c4a7d84ad2c9f9537b5f2601ac849820b616d438aa1784320492076d27a3656a6cdb8f610950027b36f036c263fd768
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cucumber
4
+ class Query
5
+ VERSION = '16.2.0'
6
+ end
7
+ end
@@ -8,7 +8,6 @@ require_relative 'repository'
8
8
  #
9
9
  # Queries can be made while the test run is incomplete - and this will naturally return incomplete results
10
10
  # see {Cucumber Messages - Message Overview}[https://github.com/cucumber/messages?tab=readme-ov-file#message-overview]
11
- #
12
11
  module Cucumber
13
12
  # Provides lookup methods for related Cucumber messages stored in the `Repository` class.
14
13
  class Query
@@ -42,10 +41,10 @@ module Cucumber
42
41
  repository.step_definition_by_id.values
43
42
  end
44
43
 
45
- # @return [Array<TestCaseStarted>]
46
- # This finds all test cases from the following conditions (UNION)
44
+ # This finds all `TestCaseStarted` messages from test cases that match either of the following conditions (UNION)
47
45
  # -> Test cases that have started, but not yet finished
48
46
  # -> Test cases that have started, finished, but that will NOT be retried
47
+ # @return [Array<TestCaseStarted>]
49
48
  def find_all_test_case_started
50
49
  repository.test_case_started_by_id.values.select do |test_case_started|
51
50
  test_case_finished = find_test_case_finished_by(test_case_started)
@@ -53,8 +52,8 @@ module Cucumber
53
52
  end
54
53
  end
55
54
 
55
+ # This finds all `TestCaseFinished` messages from test cases that have finished AND will not be retried
56
56
  # @return [Array<TestCaseFinished>]
57
- # This finds all test cases that have finished AND will not be retried
58
57
  def find_all_test_case_finished
59
58
  repository.test_case_finished_by_test_case_started_id.values.reject(&:will_be_retried)
60
59
  end
@@ -44,7 +44,7 @@ module Cucumber
44
44
 
45
45
  def method_missing(method_name, *args, &)
46
46
  if method_name.to_s.start_with?('update_')
47
- Kernel.warn("Attempting to update the repository with #{method_name}. Please raise this as a missing message handler")
47
+ Kernel.warn("Attempting to update the repository using ##{method_name}. Please raise this as a missing message handler")
48
48
  Kernel.warn('Create an issue here: https://github.com/cucumber/query/issues')
49
49
  nil
50
50
  else
@@ -63,9 +63,8 @@ module Cucumber
63
63
 
64
64
  def update_feature(feature)
65
65
  feature.children.each do |feature_child|
66
- update_steps(feature_child.background.steps) if feature_child.background
67
- update_scenario(feature_child.scenario) if feature_child.scenario
68
- feature_child.rule&.children&.each { |rule_child| _update_feature_rule(rule_child) }
66
+ _update_background_steps_and_scenario(feature_child)
67
+ feature_child.rule&.children&.each { |rule_child| _update_background_steps_and_scenario(rule_child) }
69
68
  end
70
69
  end
71
70
 
@@ -81,6 +80,11 @@ module Cucumber
81
80
  self.meta = meta
82
81
  end
83
82
 
83
+ # This deliberately doesn't perform any handling. Valid `ParameterType` messages are not needed to be stored
84
+ def update_parameter_type(_parameter_type)
85
+ :no_op
86
+ end
87
+
84
88
  def update_pickle(pickle)
85
89
  pickle_by_id[pickle.id] = pickle
86
90
  pickle.steps.each { |pickle_step| pickle_step_by_id[pickle_step.id] = pickle_step }
@@ -90,9 +94,9 @@ module Cucumber
90
94
  update_steps(scenario.steps)
91
95
  end
92
96
 
97
+ # This deliberately doesn't perform any handling. `Source` as a message is not stored or required
98
+ # -> See `GherkinDocument` for a more "parsed" form of the AST
93
99
  def update_source(_source)
94
- # This deliberately doesn't perform any handling. `Source` as a message is not stored or required
95
- # - See `GherkinDocument` for a more "parsed" form of an AST representation
96
100
  :no_op
97
101
  end
98
102
 
@@ -149,11 +153,13 @@ module Cucumber
149
153
  undefined_parameter_types << undefined_parameter_type
150
154
  end
151
155
 
152
- def _update_feature_rule(rule_child)
153
- update_steps(rule_child.background.steps) if rule_child.background
154
- update_scenario(rule_child.scenario) if rule_child.scenario
156
+ # Partial updates to some repository data (Used in `#update_feature`)
157
+ def _update_background_steps_and_scenario(entity)
158
+ update_steps(entity.background.steps) if entity.background
159
+ update_scenario(entity.scenario) if entity.scenario
155
160
  end
156
161
 
162
+ # Nested default enumerable structs used for a few entities
157
163
  def _hash_with_array_default
158
164
  Hash.new { |hash, key| hash[key] = [] }
159
165
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-query
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.1.1
4
+ version: 16.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Hill
@@ -49,14 +49,14 @@ dependencies:
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 1.88.0
52
+ version: 1.88.2
53
53
  type: :development
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: 1.88.0
59
+ version: 1.88.2
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rubocop-performance
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -92,8 +92,8 @@ extensions: []
92
92
  extra_rdoc_files: []
93
93
  files:
94
94
  - LICENSE
95
- - VERSION
96
95
  - lib/cucumber/query.rb
96
+ - lib/cucumber/query/version.rb
97
97
  - lib/cucumber/repository.rb
98
98
  homepage: https://github.com/cucumber/query
99
99
  licenses:
@@ -121,5 +121,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements: []
122
122
  rubygems_version: 4.0.16
123
123
  specification_version: 4
124
- summary: cucumber-query-16.1.1
124
+ summary: cucumber-query-16.2.0
125
125
  test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 16.1.1