cucumber-core 13.0.3 → 15.0.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 +4 -4
- data/CHANGELOG.md +25 -3
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/cucumber/core/compiler.rb +1 -1
- data/lib/cucumber/core/event.rb +1 -1
- data/lib/cucumber/core/events.rb +1 -2
- data/lib/cucumber/core/filter.rb +2 -2
- data/lib/cucumber/core/gherkin/parser.rb +1 -1
- data/lib/cucumber/core/gherkin/writer.rb +3 -3
- data/lib/cucumber/core/test/action/defined.rb +57 -0
- data/lib/cucumber/core/test/action/undefined.rb +33 -0
- data/lib/cucumber/core/test/action/unskippable.rb +18 -0
- data/lib/cucumber/core/test/action.rb +9 -0
- data/lib/cucumber/core/test/around_hook.rb +4 -4
- data/lib/cucumber/core/test/case.rb +1 -1
- data/lib/cucumber/core/test/data_table.rb +1 -1
- data/lib/cucumber/core/test/doc_string.rb +1 -3
- data/lib/cucumber/core/test/filters/locations_filter.rb +4 -4
- data/lib/cucumber/core/test/filters/name_filter.rb +1 -3
- data/lib/cucumber/core/test/filters/tag_filter.rb +1 -3
- data/lib/cucumber/core/test/location.rb +7 -7
- data/lib/cucumber/core/test/result.rb +10 -14
- data/lib/cucumber/core/test/step.rb +3 -3
- metadata +28 -28
- data/lib/cucumber/core/test/actions/action.rb +0 -57
- data/lib/cucumber/core/test/actions/undefined_action.rb +0 -31
- data/lib/cucumber/core/test/actions/unskippable_action.rb +0 -16
- data/lib/cucumber/core/test/actions.rb +0 -9
- data/lib/cucumber/core/test/filters/activate_steps_for_self_test.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a0d09660feb648bb04bbfe40f621212726b3093fa6a3fb5669b839bba45ed4
|
4
|
+
data.tar.gz: 58c8e92f97c0e7b059fe3f55cad411bf6978d74ba2479ae67d6c9ad6fd05f22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c87da17fef928935be14327463f1bc34f94a48f8ffd6c8146013f0c1692ee4a67bbe225906ac55d3ed568242bbd77bef667dc332e20b08b16a875c4f524b15e
|
7
|
+
data.tar.gz: b98f8b937b408e2698dc10cb442e70aa7f47d827c6ecb33173e03fb1c536c9492982318c774a436b457057dfaa548b8f8c115548e6a34aeffd1f100593f7b495
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,26 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
|
|
10
10
|
|
11
11
|
## [Unreleased]
|
12
12
|
|
13
|
+
## [15.0.0] - 2024-12-23
|
14
|
+
### Changed
|
15
|
+
- Permit usage of gherkin up to v29 and messages up to v28
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
- References to the Time Conversion and UUID helpers needed altering to use the `Helpers` namespace
|
19
|
+
|
20
|
+
### Removed
|
21
|
+
- Remove support for ruby 2.7 and below. 3.0 or higher is required now (Owing to messages bump)
|
22
|
+
|
23
|
+
## [14.0.0] - 2024-08-08
|
24
|
+
### Changed
|
25
|
+
- Permit usage of gherkin up to v29 and messages up to v26
|
26
|
+
- **Internal Breaking Change**: Structure of `Action` classes have changed.
|
27
|
+
See upgrading notes for [14.0.0.md](upgrading_notes/14.0.0.md#upgrading-to-cucumber-core-1400)
|
28
|
+
([#282](https://github.com/cucumber/cucumber-ruby-core/pull/282))
|
29
|
+
|
30
|
+
### Removed
|
31
|
+
- Remove support for ruby 2.6 and below. 2.7 or higher is required now (Autofixed to Ruby 2.7 styles)
|
32
|
+
|
13
33
|
## [13.0.3] - 2024-07-24
|
14
34
|
### Changed
|
15
35
|
- Fixed up all remaining Layout auto-correct cops in the codebase
|
@@ -31,8 +51,8 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
|
|
31
51
|
- Now using a 2-tiered changelog to avoid any bugs when using polyglot-release
|
32
52
|
- More refactoring of the repo by fixing up a bunch of manual rubocop offenses (See PR's for details)
|
33
53
|
([#259](https://github.com/cucumber/cucumber-ruby-core/pull/259) [#262](https://github.com/cucumber/cucumber-ruby-core/pull/262) [#268](https://github.com/cucumber/cucumber-ruby-core/pull/268) [#274](https://github.com/cucumber/cucumber-ruby-core/pull/274))
|
34
|
-
- In all `Summary` and `Result` classes, changed the `strict` argument into a keyword argument
|
35
|
-
See upgrading notes for [13.0.0.md](upgrading_notes/13.0.0.md#upgrading-to-1300)
|
54
|
+
- In all `Summary` and `Result` classes, changed the `strict` argument into a keyword argument.
|
55
|
+
See upgrading notes for [13.0.0.md](upgrading_notes/13.0.0.md#upgrading-to-cucumber-core-1300)
|
36
56
|
([#261](https://github.com/cucumber/cucumber-ruby-core/pull/261))
|
37
57
|
- Permit usage of gherkin v27
|
38
58
|
|
@@ -64,7 +84,9 @@ See upgrading notes for [13.0.0.md](upgrading_notes/13.0.0.md#upgrading-to-1300)
|
|
64
84
|
### Changed
|
65
85
|
- Updated `cucumber-gherkin` and `cucumber-messages`
|
66
86
|
|
67
|
-
[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/
|
87
|
+
[Unreleased]: https://github.com/cucumber/cucumber-ruby-core/compare/v15.0.0...HEAD
|
88
|
+
[15.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v14.0.0...v15.0.0
|
89
|
+
[14.0.0]: https://github.com/cucumber/cucumber-ruby-core/compare/v13.0.3...v14.0.0
|
68
90
|
[13.0.3]: https://github.com/cucumber/cucumber-ruby-core/compare/v13.0.2...v13.0.3
|
69
91
|
[13.0.2]: https://github.com/cucumber/cucumber-ruby-core/compare/v13.0.1...v13.0.2
|
70
92
|
[13.0.1]: https://github.com/cucumber/cucumber-ruby-core/compare/v13.0.0...v13.0.1
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -119,7 +119,7 @@ processing: it should pass ✓
|
|
119
119
|
## Documentation and support
|
120
120
|
|
121
121
|
- Getting started with Cucumber, writing features, step definitions, and more: https://cucumber.io/docs
|
122
|
-
-
|
122
|
+
- Discord ([invite link here](https://cucumber.io/docs/community/get-in-touch/#discord))
|
123
123
|
- `cucumber-core` overview: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
|
124
124
|
- How to work with local repositories for `cucumber-gherkin`, `cucumber-messages` or `cucumber-ruby`: [CONTRIBUTING.md#working-with-local-cucumber-dependencies](./CONTRIBUTING.md#working-with-local-cucumber-dependencies)
|
125
125
|
|
@@ -18,7 +18,7 @@ module Cucumber
|
|
18
18
|
|
19
19
|
def initialize(receiver, gherkin_query, event_bus = nil)
|
20
20
|
@receiver = receiver
|
21
|
-
@id_generator = Cucumber::Messages::IdGenerator::UUID.new
|
21
|
+
@id_generator = Cucumber::Messages::Helpers::IdGenerator::UUID.new
|
22
22
|
@gherkin_query = gherkin_query
|
23
23
|
@event_bus = event_bus
|
24
24
|
end
|
data/lib/cucumber/core/event.rb
CHANGED
data/lib/cucumber/core/events.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
require 'cucumber/core/event'
|
@@ -87,7 +86,7 @@ module Cucumber
|
|
87
86
|
#
|
88
87
|
# @return [Hash{Symbol => Class}]
|
89
88
|
def self.build_registry(*types)
|
90
|
-
types.
|
89
|
+
types.to_h { |type| [type.event_id, type] }
|
91
90
|
end
|
92
91
|
end
|
93
92
|
end
|
data/lib/cucumber/core/filter.rb
CHANGED
@@ -48,7 +48,7 @@ module Cucumber
|
|
48
48
|
|
49
49
|
define_method(:initialize) do |*args|
|
50
50
|
attributes.zip(args) do |name, value|
|
51
|
-
instance_variable_set("@#{name}"
|
51
|
+
instance_variable_set(:"@#{name}", value)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -63,7 +63,7 @@ module Cucumber
|
|
63
63
|
end
|
64
64
|
|
65
65
|
define_method(:with_receiver) do |new_receiver|
|
66
|
-
args = attributes.map { |name| instance_variable_get("@#{name}"
|
66
|
+
args = attributes.map { |name| instance_variable_get(:"@#{name}") }
|
67
67
|
args[-1] = new_receiver
|
68
68
|
self.class.new(*args)
|
69
69
|
end
|
@@ -50,7 +50,7 @@ module Cucumber
|
|
50
50
|
case type?(message)
|
51
51
|
when :gherkin_document; then event_bus.gherkin_source_parsed(message.gherkin_document)
|
52
52
|
when :pickle; then receiver.pickle(message.pickle)
|
53
|
-
when :parse_error; then raise ParseError
|
53
|
+
when :parse_error; then raise ParseError, "#{document.uri}: #{message.parse_error.message}"
|
54
54
|
else raise "Unknown message: #{message.to_hash}"
|
55
55
|
end
|
56
56
|
end
|
@@ -16,7 +16,8 @@ module Cucumber
|
|
16
16
|
|
17
17
|
class Gherkin
|
18
18
|
def initialize(uri, &source)
|
19
|
-
@uri
|
19
|
+
@uri = uri
|
20
|
+
@source = source
|
20
21
|
end
|
21
22
|
|
22
23
|
def comment(line)
|
@@ -193,8 +194,7 @@ module Cucumber
|
|
193
194
|
include Indentation.level(6)
|
194
195
|
include HasRows
|
195
196
|
|
196
|
-
def initialize(*)
|
197
|
-
end
|
197
|
+
def initialize(*); end
|
198
198
|
|
199
199
|
def build(source)
|
200
200
|
source + statements
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cucumber/core/test/location'
|
4
|
+
require 'cucumber/core/test/result'
|
5
|
+
require 'cucumber/core/test/timer'
|
6
|
+
|
7
|
+
module Cucumber
|
8
|
+
module Core
|
9
|
+
module Test
|
10
|
+
module Action
|
11
|
+
class Defined
|
12
|
+
attr_reader :location
|
13
|
+
|
14
|
+
def initialize(location = nil, &block)
|
15
|
+
raise ArgumentError, 'Passing a block to execute the action is mandatory.' unless block
|
16
|
+
|
17
|
+
@location = location || Test::Location.new(*block.source_location)
|
18
|
+
@block = block
|
19
|
+
@timer = Timer.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute(*args)
|
23
|
+
@timer.start
|
24
|
+
@block.call(*args)
|
25
|
+
passed
|
26
|
+
rescue Result::Raisable => e
|
27
|
+
e.with_duration(@timer.duration)
|
28
|
+
rescue Exception => e
|
29
|
+
failed(e)
|
30
|
+
end
|
31
|
+
|
32
|
+
def inspect
|
33
|
+
"#<#{self.class}: #{location}>"
|
34
|
+
end
|
35
|
+
|
36
|
+
def skip(*)
|
37
|
+
skipped
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def passed
|
43
|
+
Result::Passed.new(@timer.duration)
|
44
|
+
end
|
45
|
+
|
46
|
+
def failed(exception)
|
47
|
+
Result::Failed.new(@timer.duration, exception)
|
48
|
+
end
|
49
|
+
|
50
|
+
def skipped
|
51
|
+
Result::Skipped.new
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cucumber/core/test/result'
|
4
|
+
|
5
|
+
module Cucumber
|
6
|
+
module Core
|
7
|
+
module Test
|
8
|
+
module Action
|
9
|
+
class Undefined
|
10
|
+
attr_reader :location
|
11
|
+
|
12
|
+
def initialize(source_location)
|
13
|
+
@location = source_location
|
14
|
+
end
|
15
|
+
|
16
|
+
def execute(*)
|
17
|
+
undefined
|
18
|
+
end
|
19
|
+
|
20
|
+
def skip(*)
|
21
|
+
undefined
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def undefined
|
27
|
+
Result::Undefined.new
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cucumber/core/test/result'
|
4
|
+
require 'cucumber/core/test/action/defined'
|
5
|
+
|
6
|
+
module Cucumber
|
7
|
+
module Core
|
8
|
+
module Test
|
9
|
+
module Action
|
10
|
+
class Unskippable < Defined
|
11
|
+
def skip(*args)
|
12
|
+
execute(*args)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cucumber/core/test/location'
|
4
|
+
require 'cucumber/core/test/result'
|
5
|
+
require 'cucumber/core/test/timer'
|
6
|
+
|
7
|
+
require 'cucumber/core/test/action/defined'
|
8
|
+
require 'cucumber/core/test/action/undefined'
|
9
|
+
require 'cucumber/core/test/action/unskippable'
|
@@ -21,10 +21,10 @@ module Cucumber
|
|
21
21
|
@timer.start
|
22
22
|
@block.call(continue)
|
23
23
|
Result::Unknown.new # Around hook does not know the result of the inner test steps
|
24
|
-
rescue Result::Raisable =>
|
25
|
-
|
26
|
-
rescue Exception =>
|
27
|
-
failed(
|
24
|
+
rescue Result::Raisable => e
|
25
|
+
e.with_duration(@timer.duration)
|
26
|
+
rescue Exception => e
|
27
|
+
failed(e)
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
@@ -10,7 +10,7 @@ module Cucumber
|
|
10
10
|
attr_reader :id, :name, :test_steps, :location, :parent_locations, :tags, :language, :around_hooks
|
11
11
|
|
12
12
|
def initialize(id, name, test_steps, location, parent_locations, tags, language, around_hooks = [])
|
13
|
-
raise ArgumentError
|
13
|
+
raise ArgumentError, "test_steps should be an Array but is a #{test_steps.class}" unless test_steps.is_a?(Array)
|
14
14
|
|
15
15
|
@id = id
|
16
16
|
@name = name
|
@@ -60,9 +60,7 @@ module Cucumber
|
|
60
60
|
if other.respond_to?(:content_type)
|
61
61
|
return false unless content_type == other.content_type
|
62
62
|
end
|
63
|
-
if other.respond_to?(:to_str)
|
64
|
-
return content == other.to_str
|
65
|
-
end
|
63
|
+
return content == other.to_str if other.respond_to?(:to_str)
|
66
64
|
|
67
65
|
false
|
68
66
|
end
|
@@ -23,11 +23,11 @@ module Cucumber
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def sorted_test_cases
|
26
|
-
filter_locations.map
|
27
|
-
test_cases[filter_location.file].select
|
26
|
+
filter_locations.map do |filter_location|
|
27
|
+
test_cases[filter_location.file].select do |test_case|
|
28
28
|
test_case.match_locations?([filter_location])
|
29
|
-
|
30
|
-
|
29
|
+
end
|
30
|
+
end.flatten.uniq
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_cases
|
@@ -8,9 +8,7 @@ module Cucumber
|
|
8
8
|
class TagFilter < Filter.new(:filter_expressions)
|
9
9
|
def test_case(test_case)
|
10
10
|
test_cases << test_case
|
11
|
-
if test_case.match_tags?(filter_expressions)
|
12
|
-
test_case.describe_to(receiver)
|
13
|
-
end
|
11
|
+
test_case.describe_to(receiver) if test_case.match_tags?(filter_expressions)
|
14
12
|
self
|
15
13
|
end
|
16
14
|
|
@@ -22,7 +22,7 @@ module Cucumber
|
|
22
22
|
pwd = File.expand_path(Dir.pwd)
|
23
23
|
pwd.force_encoding(file.encoding)
|
24
24
|
if file.index(pwd)
|
25
|
-
file = file[pwd.length + 1
|
25
|
+
file = file[pwd.length + 1..]
|
26
26
|
elsif file =~ /.*\/gems\/(.*\.rb)$/
|
27
27
|
file = $1
|
28
28
|
end
|
@@ -38,7 +38,7 @@ module Cucumber
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
|
41
|
+
Wildcard = Struct.new(:file) do
|
42
42
|
def to_s
|
43
43
|
file
|
44
44
|
end
|
@@ -52,7 +52,7 @@ module Cucumber
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
|
55
|
+
Precise = Struct.new(:file, :lines) do
|
56
56
|
def include?(other_lines)
|
57
57
|
lines.include?(other_lines)
|
58
58
|
end
|
@@ -96,7 +96,7 @@ module Cucumber
|
|
96
96
|
end
|
97
97
|
|
98
98
|
require 'set'
|
99
|
-
|
99
|
+
Lines = Struct.new(:data) do
|
100
100
|
protected :data
|
101
101
|
|
102
102
|
def initialize(raw_data)
|
@@ -167,17 +167,17 @@ module Cucumber
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def tags
|
170
|
-
# will be
|
170
|
+
# will be overridden by nodes that actually have tags
|
171
171
|
[]
|
172
172
|
end
|
173
173
|
|
174
174
|
def comments
|
175
|
-
# will be
|
175
|
+
# will be overridden by nodes that actually have comments
|
176
176
|
[]
|
177
177
|
end
|
178
178
|
|
179
179
|
def multiline_arg
|
180
|
-
# will be
|
180
|
+
# will be overridden by nodes that actually have a multiline_argument
|
181
181
|
Test::EmptyMultilineArgument.new
|
182
182
|
end
|
183
183
|
end
|
@@ -1,8 +1,7 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
require 'cucumber/messages'
|
5
|
-
require 'cucumber/messages/time_conversion'
|
4
|
+
require 'cucumber/messages/helpers/time_conversion'
|
6
5
|
|
7
6
|
module Cucumber
|
8
7
|
module Core
|
@@ -18,8 +17,7 @@ module Cucumber
|
|
18
17
|
|
19
18
|
# Defines to_sym on a result class for the given result type
|
20
19
|
#
|
21
|
-
# Defines predicate methods on a result class with only the given one
|
22
|
-
# returning true
|
20
|
+
# Defines predicate methods on a result class with only the given one returning true
|
23
21
|
def self.query_methods(result_type)
|
24
22
|
Module.new do
|
25
23
|
define_method :to_sym do
|
@@ -167,13 +165,13 @@ module Cucumber
|
|
167
165
|
end
|
168
166
|
end
|
169
167
|
|
170
|
-
# Base class for exceptions that can be raised in a step definition causing
|
171
|
-
# the step to have that result.
|
168
|
+
# Base class for exceptions that can be raised in a step definition causing the step to have that result.
|
172
169
|
class Raisable < StandardError
|
173
170
|
attr_reader :message, :duration
|
174
171
|
|
175
172
|
def initialize(message = '', duration = UnknownDuration.new, backtrace = nil)
|
176
|
-
@message
|
173
|
+
@message = message
|
174
|
+
@duration = duration
|
177
175
|
super(message)
|
178
176
|
set_backtrace(backtrace) if backtrace
|
179
177
|
end
|
@@ -287,7 +285,7 @@ module Cucumber
|
|
287
285
|
private :settings
|
288
286
|
|
289
287
|
def initialize(strict_types = [])
|
290
|
-
@settings = STRICT_AFFECTED_TYPES.
|
288
|
+
@settings = STRICT_AFFECTED_TYPES.to_h { |t| [t, :default] }
|
291
289
|
strict_types.each do |type|
|
292
290
|
set_strict(true, type)
|
293
291
|
end
|
@@ -295,7 +293,7 @@ module Cucumber
|
|
295
293
|
|
296
294
|
def strict?(type = nil)
|
297
295
|
if type.nil?
|
298
|
-
settings.
|
296
|
+
settings.each_value do |value|
|
299
297
|
return true if value == true
|
300
298
|
end
|
301
299
|
false
|
@@ -309,9 +307,7 @@ module Cucumber
|
|
309
307
|
|
310
308
|
def set_strict(setting, type = nil)
|
311
309
|
if type.nil?
|
312
|
-
STRICT_AFFECTED_TYPES.each
|
313
|
-
set_strict(setting, t)
|
314
|
-
end
|
310
|
+
STRICT_AFFECTED_TYPES.each { |type| set_strict(setting, type) }
|
315
311
|
else
|
316
312
|
settings[type] = setting
|
317
313
|
end
|
@@ -404,7 +400,7 @@ module Cucumber
|
|
404
400
|
end
|
405
401
|
|
406
402
|
class Duration
|
407
|
-
include Cucumber::Messages::TimeConversion
|
403
|
+
include Cucumber::Messages::Helpers::TimeConversion
|
408
404
|
|
409
405
|
attr_reader :nanoseconds
|
410
406
|
|
@@ -425,7 +421,7 @@ module Cucumber
|
|
425
421
|
end
|
426
422
|
|
427
423
|
class UnknownDuration
|
428
|
-
include Cucumber::Messages::TimeConversion
|
424
|
+
include Cucumber::Messages::Helpers::TimeConversion
|
429
425
|
|
430
426
|
def tap
|
431
427
|
self
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'cucumber/core/test/result'
|
4
|
-
require 'cucumber/core/test/
|
4
|
+
require 'cucumber/core/test/action'
|
5
5
|
require 'cucumber/core/test/empty_multiline_argument'
|
6
6
|
|
7
7
|
module Cucumber
|
@@ -10,7 +10,7 @@ module Cucumber
|
|
10
10
|
class Step
|
11
11
|
attr_reader :id, :text, :location, :multiline_arg
|
12
12
|
|
13
|
-
def initialize(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::
|
13
|
+
def initialize(id, text, location, multiline_arg = Test::EmptyMultilineArgument.new, action = Test::Action::Undefined.new(location))
|
14
14
|
raise ArgumentError if text.nil? || text.empty?
|
15
15
|
|
16
16
|
@id = id
|
@@ -37,7 +37,7 @@ module Cucumber
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def with_action(action_location = nil, &block)
|
40
|
-
self.class.new(id, text, location, multiline_arg, Test::Action.new(action_location, &block))
|
40
|
+
self.class.new(id, text, location, multiline_arg, Test::Action::Defined.new(action_location, &block))
|
41
41
|
end
|
42
42
|
|
43
43
|
def backtrace_line
|
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: 15.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -12,48 +12,48 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2024-
|
15
|
+
date: 2024-12-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: cucumber-gherkin
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - ">"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '27'
|
24
24
|
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '30'
|
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
33
|
version: '27'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '30'
|
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: '25'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '28'
|
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: '25'
|
54
54
|
- - "<"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
56
|
+
version: '28'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: cucumber-tag-expressions
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,14 +80,14 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '13.
|
83
|
+
version: '13.2'
|
84
84
|
type: :development
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '13.
|
90
|
+
version: '13.2'
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rspec
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,28 +108,28 @@ dependencies:
|
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 1.
|
111
|
+
version: 1.69.0
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.
|
118
|
+
version: 1.69.0
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: rubocop-packaging
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.5.
|
125
|
+
version: 0.5.2
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 0.5.
|
132
|
+
version: 0.5.2
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: rubocop-rake
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,14 +150,14 @@ dependencies:
|
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
153
|
+
version: 3.0.5
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
156
|
version_requirements: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
158
|
- - "~>"
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
160
|
+
version: 3.0.5
|
161
161
|
description: Core library for the Cucumber BDD app
|
162
162
|
email: cukes@googlegroups.com
|
163
163
|
executables: []
|
@@ -179,17 +179,16 @@ files:
|
|
179
179
|
- lib/cucumber/core/gherkin/writer/helpers.rb
|
180
180
|
- lib/cucumber/core/platform.rb
|
181
181
|
- lib/cucumber/core/report/summary.rb
|
182
|
-
- lib/cucumber/core/test/
|
183
|
-
- lib/cucumber/core/test/
|
184
|
-
- lib/cucumber/core/test/
|
185
|
-
- lib/cucumber/core/test/
|
182
|
+
- lib/cucumber/core/test/action.rb
|
183
|
+
- lib/cucumber/core/test/action/defined.rb
|
184
|
+
- lib/cucumber/core/test/action/undefined.rb
|
185
|
+
- lib/cucumber/core/test/action/unskippable.rb
|
186
186
|
- lib/cucumber/core/test/around_hook.rb
|
187
187
|
- lib/cucumber/core/test/case.rb
|
188
188
|
- lib/cucumber/core/test/data_table.rb
|
189
189
|
- lib/cucumber/core/test/doc_string.rb
|
190
190
|
- lib/cucumber/core/test/empty_multiline_argument.rb
|
191
191
|
- lib/cucumber/core/test/filters.rb
|
192
|
-
- lib/cucumber/core/test/filters/activate_steps_for_self_test.rb
|
193
192
|
- lib/cucumber/core/test/filters/locations_filter.rb
|
194
193
|
- lib/cucumber/core/test/filters/name_filter.rb
|
195
194
|
- lib/cucumber/core/test/filters/tag_filter.rb
|
@@ -209,6 +208,7 @@ metadata:
|
|
209
208
|
documentation_uri: https://www.rubydoc.info/github/cucumber/cucumber-ruby-core
|
210
209
|
mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
|
211
210
|
source_code_uri: https://github.com/cucumber/cucumber-ruby-core
|
211
|
+
funding_uri: https://opencollective.com/cucumber
|
212
212
|
post_install_message:
|
213
213
|
rdoc_options:
|
214
214
|
- "--charset=UTF-8"
|
@@ -218,15 +218,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
218
|
requirements:
|
219
219
|
- - ">="
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '
|
221
|
+
version: '3.0'
|
222
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
223
|
requirements:
|
224
224
|
- - ">="
|
225
225
|
- !ruby/object:Gem::Version
|
226
|
-
version: 3.
|
226
|
+
version: 3.2.8
|
227
227
|
requirements: []
|
228
228
|
rubygems_version: 3.3.5
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
|
-
summary: cucumber-core-
|
231
|
+
summary: cucumber-core-15.0.0
|
232
232
|
test_files: []
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'cucumber/core/test/location'
|
4
|
-
require 'cucumber/core/test/result'
|
5
|
-
require 'cucumber/core/test/timer'
|
6
|
-
|
7
|
-
module Cucumber
|
8
|
-
module Core
|
9
|
-
module Test
|
10
|
-
class Action
|
11
|
-
def initialize(location = nil, &block)
|
12
|
-
raise ArgumentError, 'Passing a block to execute the action is mandatory.' unless block
|
13
|
-
|
14
|
-
@location = location || Test::Location.new(*block.source_location)
|
15
|
-
@block = block
|
16
|
-
@timer = Timer.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def skip(*)
|
20
|
-
skipped
|
21
|
-
end
|
22
|
-
|
23
|
-
def execute(*args)
|
24
|
-
@timer.start
|
25
|
-
@block.call(*args)
|
26
|
-
passed
|
27
|
-
rescue Result::Raisable => exception
|
28
|
-
exception.with_duration(@timer.duration)
|
29
|
-
rescue Exception => exception
|
30
|
-
failed(exception)
|
31
|
-
end
|
32
|
-
|
33
|
-
def location
|
34
|
-
@location
|
35
|
-
end
|
36
|
-
|
37
|
-
def inspect
|
38
|
-
"#<#{self.class}: #{location}>"
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def passed
|
44
|
-
Result::Passed.new(@timer.duration)
|
45
|
-
end
|
46
|
-
|
47
|
-
def failed(exception)
|
48
|
-
Result::Failed.new(@timer.duration, exception)
|
49
|
-
end
|
50
|
-
|
51
|
-
def skipped
|
52
|
-
Result::Skipped.new
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'cucumber/core/test/result'
|
4
|
-
|
5
|
-
module Cucumber
|
6
|
-
module Core
|
7
|
-
module Test
|
8
|
-
class UndefinedAction
|
9
|
-
attr_reader :location
|
10
|
-
|
11
|
-
def initialize(source_location)
|
12
|
-
@location = source_location
|
13
|
-
end
|
14
|
-
|
15
|
-
def execute(*)
|
16
|
-
undefined
|
17
|
-
end
|
18
|
-
|
19
|
-
def skip(*)
|
20
|
-
undefined
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def undefined
|
26
|
-
Result::Undefined.new
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'cucumber/core/test/result'
|
4
|
-
require 'cucumber/core/test/actions/action'
|
5
|
-
|
6
|
-
module Cucumber
|
7
|
-
module Core
|
8
|
-
module Test
|
9
|
-
class UnskippableAction < Action
|
10
|
-
def skip(*args)
|
11
|
-
execute(*args)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'cucumber/core/test/location'
|
4
|
-
require 'cucumber/core/test/result'
|
5
|
-
require 'cucumber/core/test/timer'
|
6
|
-
|
7
|
-
require 'cucumber/core/test/actions/action'
|
8
|
-
require 'cucumber/core/test/actions/undefined_action'
|
9
|
-
require 'cucumber/core/test/actions/unskippable_action'
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
module Core
|
5
|
-
module Test
|
6
|
-
module Filters
|
7
|
-
# This filter is used for testing Cucumber itself. It adds step definitions
|
8
|
-
# that will activate steps to have passed / failed / pending results
|
9
|
-
# if they use conventional names.
|
10
|
-
#
|
11
|
-
# It was extracted from our test code, and does not have any tests of its own.
|
12
|
-
class ActivateStepsForSelfTest < Core::Filter.new
|
13
|
-
Failure = Class.new(StandardError)
|
14
|
-
|
15
|
-
def test_case(test_case)
|
16
|
-
test_case.with_steps(test_steps(test_case)).describe_to(receiver)
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def test_steps(test_case)
|
22
|
-
test_case.test_steps.map do |step|
|
23
|
-
case step.text
|
24
|
-
when /fail/ then step.with_action { raise Failure }
|
25
|
-
when /pending/ then step.with_action { raise Test::Result::Pending }
|
26
|
-
when /pass/ then step.with_action { :no_op }
|
27
|
-
else; step
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|