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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -254
- data/README.md +3 -2
- data/lib/cucumber/core/compiler.rb +41 -20
- data/lib/cucumber/core/event.rb +26 -27
- data/lib/cucumber/core/event_bus.rb +16 -19
- data/lib/cucumber/core/events.rb +3 -11
- data/lib/cucumber/core/filter.rb +1 -3
- data/lib/cucumber/core/gherkin/parser.rb +41 -13
- data/lib/cucumber/core/gherkin/writer/helpers.rb +6 -4
- data/lib/cucumber/core/gherkin/writer.rb +11 -2
- data/lib/cucumber/core/platform.rb +2 -1
- data/lib/cucumber/core/report/summary.rb +14 -5
- data/lib/cucumber/core/test/action.rb +3 -3
- data/lib/cucumber/core/test/around_hook.rb +3 -1
- data/lib/cucumber/core/test/case.rb +6 -4
- data/lib/cucumber/core/test/data_table.rb +4 -7
- data/lib/cucumber/core/test/doc_string.rb +6 -5
- data/lib/cucumber/core/test/empty_multiline_argument.rb +2 -1
- data/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb +3 -3
- data/lib/cucumber/core/test/filters/locations_filter.rb +1 -2
- data/lib/cucumber/core/test/filters/name_filter.rb +1 -1
- data/lib/cucumber/core/test/filters/tag_filter.rb +1 -1
- data/lib/cucumber/core/test/filters.rb +1 -0
- data/lib/cucumber/core/test/location.rb +6 -7
- data/lib/cucumber/core/test/result.rb +41 -37
- data/lib/cucumber/core/test/runner.rb +7 -7
- data/lib/cucumber/core/test/tag.rb +1 -0
- data/lib/cucumber/core/test/timer.rb +1 -0
- data/lib/cucumber/core.rb +1 -1
- metadata +42 -46
@@ -1,7 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require
|
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,
|
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?(
|
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(
|
41
|
+
def describe_to(_visitor, *_args)
|
41
42
|
self
|
42
43
|
end
|
43
44
|
|
44
|
-
def with_filtered_backtrace(
|
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?(
|
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?
|
87
|
+
def ok?
|
87
88
|
self.class.ok?
|
88
89
|
end
|
89
90
|
|
90
|
-
def with_appended_backtrace(
|
91
|
+
def with_appended_backtrace(_step)
|
91
92
|
self
|
92
93
|
end
|
93
94
|
|
94
|
-
def with_filtered_backtrace(
|
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?(
|
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?(
|
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?(
|
163
|
-
!
|
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 =
|
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?(
|
199
|
-
self.class.ok?(
|
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?(
|
207
|
-
!
|
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?(
|
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?(
|
257
|
-
!
|
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
|
-
|
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
|
-
#
|
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, *
|
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
|
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,
|
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,
|
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
|
-
|
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
|
425
|
+
def tap
|
422
426
|
self
|
423
427
|
end
|
424
428
|
|
425
429
|
def nanoseconds
|
426
|
-
raise
|
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(
|
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(
|
86
|
+
def exception(_step_exception, _step_result)
|
86
87
|
self
|
87
88
|
end
|
88
89
|
|
89
|
-
def duration(
|
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,
|
114
|
+
raise NoMethodError, 'Override me'
|
114
115
|
end
|
115
116
|
end
|
116
117
|
|
117
118
|
class Unknown < Base
|
118
|
-
def result(
|
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
|
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
|
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:
|
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:
|
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: '
|
23
|
+
version: '27'
|
24
24
|
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
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: '
|
33
|
+
version: '27'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
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: '
|
43
|
+
version: '20'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
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: '
|
53
|
+
version: '20'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
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: '
|
64
|
-
- - "
|
63
|
+
version: '5'
|
64
|
+
- - "<"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
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: '
|
74
|
-
- - "
|
73
|
+
version: '5'
|
74
|
+
- - "<"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
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:
|
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:
|
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-
|
132
|
+
name: rubocop-rake
|
139
133
|
requirement: !ruby/object:Gem::Requirement
|
140
134
|
requirements:
|
141
135
|
- - "~>"
|
142
136
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
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:
|
154
|
-
- - ">="
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
version: 0.5.1
|
144
|
+
version: 0.6.0
|
157
145
|
- !ruby/object:Gem::Dependency
|
158
|
-
name:
|
146
|
+
name: rubocop-rspec
|
159
147
|
requirement: !ruby/object:Gem::Requirement
|
160
148
|
requirements:
|
161
149
|
- - "~>"
|
162
150
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
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:
|
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:
|
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.
|
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:
|
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-
|
240
|
+
summary: cucumber-core-13.0.0
|
245
241
|
test_files: []
|