cucumber-core 11.1.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,8 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
- require "cucumber/messages"
4
- require "cucumber/messages/time_conversion"
3
+
4
+ require 'cucumber/messages'
5
+ require 'cucumber/messages/time_conversion'
5
6
 
6
7
  module Cucumber
7
8
  module Core
@@ -10,9 +11,9 @@ module Cucumber
10
11
  TYPES = [:failed, :flaky, :skipped, :undefined, :pending, :passed, :unknown].freeze
11
12
  STRICT_AFFECTED_TYPES = [:flaky, :undefined, :pending].freeze
12
13
 
13
- def self.ok?(type, be_strict = StrictConfiguration.new)
14
+ def self.ok?(type, strict: StrictConfiguration.new)
14
15
  class_name = type.to_s.slice(0, 1).capitalize + type.to_s.slice(1..-1)
15
- const_get(class_name).ok?(be_strict.strict?(type))
16
+ const_get(class_name).ok?(strict: strict.strict?(type))
16
17
  end
17
18
 
18
19
  # Defines to_sym on a result class for the given result type
@@ -37,11 +38,11 @@ module Cucumber
37
38
  class Unknown
38
39
  include Result.query_methods :unknown
39
40
 
40
- def describe_to(visitor, *args)
41
+ def describe_to(_visitor, *_args)
41
42
  self
42
43
  end
43
44
 
44
- def with_filtered_backtrace(filter)
45
+ def with_filtered_backtrace(_filter)
45
46
  self
46
47
  end
47
48
 
@@ -57,7 +58,7 @@ module Cucumber
57
58
  include Result.query_methods :passed
58
59
  attr_accessor :duration
59
60
 
60
- def self.ok?(be_strict = false)
61
+ def self.ok?(*)
61
62
  true
62
63
  end
63
64
 
@@ -73,7 +74,7 @@ module Cucumber
73
74
  end
74
75
 
75
76
  def to_s
76
- ""
77
+ ''
77
78
  end
78
79
 
79
80
  def to_message
@@ -83,15 +84,15 @@ module Cucumber
83
84
  )
84
85
  end
85
86
 
86
- def ok?(be_strict = nil)
87
+ def ok?
87
88
  self.class.ok?
88
89
  end
89
90
 
90
- def with_appended_backtrace(step)
91
+ def with_appended_backtrace(_step)
91
92
  self
92
93
  end
93
94
 
94
- def with_filtered_backtrace(filter)
95
+ def with_filtered_backtrace(_filter)
95
96
  self
96
97
  end
97
98
  end
@@ -101,7 +102,7 @@ module Cucumber
101
102
 
102
103
  attr_reader :duration, :exception
103
104
 
104
- def self.ok?(be_strict = false)
105
+ def self.ok?(*)
105
106
  false
106
107
  end
107
108
 
@@ -120,14 +121,14 @@ module Cucumber
120
121
  end
121
122
 
122
123
  def to_s
123
- ""
124
+ ''
124
125
  end
125
126
 
126
127
  def to_message
127
128
  begin
128
129
  message = exception.backtrace.join("\n")
129
130
  rescue NoMethodError
130
- message = ""
131
+ message = ''
131
132
  end
132
133
 
133
134
  Cucumber::Messages::TestStepResult.new(
@@ -137,7 +138,7 @@ module Cucumber
137
138
  )
138
139
  end
139
140
 
140
- def ok?(be_strict = nil)
141
+ def ok?(*)
141
142
  self.class.ok?
142
143
  end
143
144
 
@@ -159,8 +160,8 @@ module Cucumber
159
160
  # reporting result type for test cases that fails and the passes on
160
161
  # retry, therefore only the class method self.ok? is needed.
161
162
  class Flaky
162
- def self.ok?(be_strict = false)
163
- !be_strict
163
+ def self.ok?(strict: false)
164
+ !strict
164
165
  end
165
166
  end
166
167
 
@@ -169,7 +170,7 @@ module Cucumber
169
170
  class Raisable < StandardError
170
171
  attr_reader :message, :duration
171
172
 
172
- def initialize(message = "", duration = UnknownDuration.new, backtrace = nil)
173
+ def initialize(message = '', duration = UnknownDuration.new, backtrace = nil)
173
174
  @message, @duration = message, duration
174
175
  super(message)
175
176
  set_backtrace(backtrace) if backtrace
@@ -195,16 +196,16 @@ module Cucumber
195
196
  filter.new(dup).exception
196
197
  end
197
198
 
198
- def ok?(be_strict = StrictConfiguration.new)
199
- self.class.ok?(be_strict.strict?(to_sym))
199
+ def ok?(strict: StrictConfiguration.new)
200
+ self.class.ok?(strict: strict.strict?(to_sym))
200
201
  end
201
202
  end
202
203
 
203
204
  class Undefined < Raisable
204
205
  include Result.query_methods :undefined
205
206
 
206
- def self.ok?(be_strict = false)
207
- !be_strict
207
+ def self.ok?(strict: false)
208
+ !strict
208
209
  end
209
210
 
210
211
  def describe_to(visitor, *args)
@@ -214,7 +215,7 @@ module Cucumber
214
215
  end
215
216
 
216
217
  def to_s
217
- "?"
218
+ '?'
218
219
  end
219
220
 
220
221
  def to_message
@@ -228,7 +229,7 @@ module Cucumber
228
229
  class Skipped < Raisable
229
230
  include Result.query_methods :skipped
230
231
 
231
- def self.ok?(be_strict = false)
232
+ def self.ok?(*)
232
233
  true
233
234
  end
234
235
 
@@ -239,7 +240,7 @@ module Cucumber
239
240
  end
240
241
 
241
242
  def to_s
242
- "-"
243
+ '-'
243
244
  end
244
245
 
245
246
  def to_message
@@ -253,8 +254,8 @@ module Cucumber
253
254
  class Pending < Raisable
254
255
  include Result.query_methods :pending
255
256
 
256
- def self.ok?(be_strict = false)
257
- !be_strict
257
+ def self.ok?(strict: false)
258
+ !strict
258
259
  end
259
260
 
260
261
  def describe_to(visitor, *args)
@@ -264,7 +265,7 @@ module Cucumber
264
265
  end
265
266
 
266
267
  def to_s
267
- "P"
268
+ 'P'
268
269
  end
269
270
 
270
271
  def to_message
@@ -324,8 +325,7 @@ module Cucumber
324
325
  end
325
326
 
326
327
  #
327
- # An object that responds to the description protocol from the results
328
- # and collects summary information.
328
+ # An object that responds to the description protocol from the results and collects summary information.
329
329
  #
330
330
  # e.g.
331
331
  # summary = Result::Summary.new
@@ -342,7 +342,7 @@ module Cucumber
342
342
  @durations = []
343
343
  end
344
344
 
345
- def method_missing(name, *args)
345
+ def method_missing(name, *_args)
346
346
  if name =~ /^total_/
347
347
  get_total(name)
348
348
  else
@@ -350,10 +350,14 @@ module Cucumber
350
350
  end
351
351
  end
352
352
 
353
- def ok?(be_strict = StrictConfiguration.new)
353
+ def respond_to_missing?(*)
354
+ true
355
+ end
356
+
357
+ def ok?(strict: StrictConfiguration.new)
354
358
  TYPES.each do |type|
355
359
  if get_total(type) > 0
356
- return false unless Result.ok?(type, be_strict)
360
+ return false unless Result.ok?(type, strict: strict)
357
361
  end
358
362
  end
359
363
  true
@@ -373,7 +377,7 @@ module Cucumber
373
377
  if for_status
374
378
  @totals.fetch(for_status, 0)
375
379
  else
376
- @totals.reduce(0) { |total, status| total += status[1] }
380
+ @totals.values.reduce(0) { |total,count| total + count }
377
381
  end
378
382
  end
379
383
 
@@ -385,7 +389,7 @@ module Cucumber
385
389
 
386
390
  def get_total(method_name)
387
391
  status = method_name.to_s.gsub('total_', '').to_sym
388
- return @totals.fetch(status, 0)
392
+ @totals.fetch(status, 0)
389
393
  end
390
394
 
391
395
  def increment_total(status)
@@ -418,12 +422,12 @@ module Cucumber
418
422
  class UnknownDuration
419
423
  include Cucumber::Messages::TimeConversion
420
424
 
421
- def tap(&block)
425
+ def tap
422
426
  self
423
427
  end
424
428
 
425
429
  def nanoseconds
426
- raise "#nanoseconds only allowed to be used in #tap block"
430
+ raise '#nanoseconds only allowed to be used in #tap block'
427
431
  end
428
432
 
429
433
  def to_message_duration
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'cucumber/core/test/timer'
3
4
 
4
5
  module Cucumber
@@ -67,7 +68,7 @@ module Cucumber
67
68
  self
68
69
  end
69
70
 
70
- def pending(message, step_result)
71
+ def pending(_message, step_result)
71
72
  @status = Status::Pending.new(step_result)
72
73
  self
73
74
  end
@@ -82,11 +83,11 @@ module Cucumber
82
83
  self
83
84
  end
84
85
 
85
- def exception(step_exception, step_result)
86
+ def exception(_step_exception, _step_result)
86
87
  self
87
88
  end
88
89
 
89
- def duration(step_duration, step_result)
90
+ def duration(_step_duration, _step_result)
90
91
  self
91
92
  end
92
93
 
@@ -110,12 +111,12 @@ module Cucumber
110
111
  end
111
112
 
112
113
  def result
113
- raise NoMethodError, "Override me"
114
+ raise NoMethodError, 'Override me'
114
115
  end
115
116
  end
116
117
 
117
118
  class Unknown < Base
118
- def result(duration)
119
+ def result(_duration)
119
120
  Result::Unknown.new
120
121
  end
121
122
  end
@@ -127,7 +128,7 @@ module Cucumber
127
128
  end
128
129
 
129
130
  class Failing < Base
130
- def execute(test_step, monitor, &continue)
131
+ def execute(test_step, monitor)
131
132
  result = test_step.skip(monitor.result)
132
133
  if result.undefined?
133
134
  result = result.with_message(%(Undefined step: "#{test_step.text}"))
@@ -150,7 +151,6 @@ module Cucumber
150
151
  end
151
152
  end
152
153
  end
153
-
154
154
  end
155
155
  end
156
156
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Cucumber
3
4
  module Core
4
5
  module Test
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'cucumber/core/test/result'
3
4
 
4
5
  module Cucumber
data/lib/cucumber/core.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'cucumber/core/event_bus'
3
4
  require 'cucumber/core/gherkin/parser'
4
5
  require 'cucumber/core/gherkin/document'
@@ -9,7 +10,6 @@ require 'gherkin/query'
9
10
 
10
11
  module Cucumber
11
12
  module Core
12
-
13
13
  def execute(gherkin_documents, filters = [], event_bus = EventBus.new)
14
14
  yield event_bus if block_given?
15
15
  receiver = Test::Runner.new(event_bus)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.0
4
+ version: 13.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-12-23 00:00:00.000000000 Z
15
+ date: 2023-12-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: cucumber-gherkin
@@ -20,60 +20,60 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: '24'
23
+ version: '27'
24
24
  - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: '27'
26
+ version: '28'
27
27
  type: :runtime
28
28
  prerelease: false
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '24'
33
+ version: '27'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '27'
36
+ version: '28'
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: cucumber-messages
39
39
  requirement: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '19'
43
+ version: '20'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '22'
46
+ version: '23'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '19'
53
+ version: '20'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '22'
56
+ version: '23'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: cucumber-tag-expressions
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - "~>"
61
+ - - ">"
62
62
  - !ruby/object:Gem::Version
63
- version: '4.1'
64
- - - ">="
63
+ version: '5'
64
+ - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: 4.1.0
66
+ version: '7'
67
67
  type: :runtime
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - "~>"
71
+ - - ">"
72
72
  - !ruby/object:Gem::Version
73
- version: '4.1'
74
- - - ">="
73
+ version: '5'
74
+ - - "<"
75
75
  - !ruby/object:Gem::Version
76
- version: 4.1.0
76
+ version: '7'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rake
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -120,60 +120,56 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '1.29'
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 1.29.1
123
+ version: 1.28.2
127
124
  type: :development
128
125
  prerelease: false
129
126
  version_requirements: !ruby/object:Gem::Requirement
130
127
  requirements:
131
128
  - - "~>"
132
129
  - !ruby/object:Gem::Version
133
- version: '1.29'
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 1.29.1
130
+ version: 1.28.2
137
131
  - !ruby/object:Gem::Dependency
138
- name: rubocop-packaging
132
+ name: rubocop-rake
139
133
  requirement: !ruby/object:Gem::Requirement
140
134
  requirements:
141
135
  - - "~>"
142
136
  - !ruby/object:Gem::Version
143
- version: '0.5'
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 0.5.1
137
+ version: 0.6.0
147
138
  type: :development
148
139
  prerelease: false
149
140
  version_requirements: !ruby/object:Gem::Requirement
150
141
  requirements:
151
142
  - - "~>"
152
143
  - !ruby/object:Gem::Version
153
- version: '0.5'
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 0.5.1
144
+ version: 0.6.0
157
145
  - !ruby/object:Gem::Dependency
158
- name: unindent
146
+ name: rubocop-rspec
159
147
  requirement: !ruby/object:Gem::Requirement
160
148
  requirements:
161
149
  - - "~>"
162
150
  - !ruby/object:Gem::Version
163
- version: '1.0'
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '1.0'
151
+ version: 2.10.0
167
152
  type: :development
168
153
  prerelease: false
169
154
  version_requirements: !ruby/object:Gem::Requirement
170
155
  requirements:
171
156
  - - "~>"
172
157
  - !ruby/object:Gem::Version
173
- version: '1.0'
174
- - - ">="
158
+ version: 2.10.0
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-packaging
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
175
164
  - !ruby/object:Gem::Version
176
- version: '1.0'
165
+ version: 0.5.1
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: 0.5.1
177
173
  description: Core library for the Cucumber BDD app
178
174
  email: cukes@googlegroups.com
179
175
  executables: []
@@ -231,15 +227,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
227
  requirements:
232
228
  - - ">="
233
229
  - !ruby/object:Gem::Version
234
- version: '2.3'
230
+ version: '2.5'
235
231
  required_rubygems_version: !ruby/object:Gem::Requirement
236
232
  requirements:
237
233
  - - ">="
238
234
  - !ruby/object:Gem::Version
239
- version: '0'
235
+ version: 3.0.1
240
236
  requirements: []
241
237
  rubygems_version: 3.3.5
242
238
  signing_key:
243
239
  specification_version: 4
244
- summary: cucumber-core-11.1.0
240
+ summary: cucumber-core-13.0.0
245
241
  test_files: []