cucumber-compatibility-kit 13.0.1 → 14.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/attachments/attachments.feature +16 -12
- data/features/attachments/attachments.feature.ndjson +97 -80
- data/features/attachments/attachments.feature.rb +4 -12
- data/features/cdata/cdata.feature +0 -1
- data/features/cdata/cdata.feature.ndjson +4 -4
- data/features/cdata/cdata.feature.rb +5 -0
- data/features/data-tables/data-tables.feature +4 -3
- data/features/data-tables/data-tables.feature.ndjson +3 -3
- data/features/examples-tables/examples-tables.feature +4 -5
- data/features/examples-tables/examples-tables.feature.ndjson +11 -11
- data/features/hooks/hooks.feature +9 -8
- data/features/hooks/hooks.feature.ndjson +18 -18
- data/features/hooks/hooks.feature.rb +4 -4
- data/features/markdown/markdown.feature.md.ndjson +1 -1
- data/features/minimal/minimal.feature.ndjson +2 -2
- data/features/minimal/minimal.feature.rb +2 -1
- data/features/parameter-types/parameter-types.feature +8 -6
- data/features/parameter-types/parameter-types.feature.ndjson +6 -6
- data/features/parameter-types/parameter-types.feature.rb +2 -3
- data/features/pending/pending.feature +5 -6
- data/features/pending/pending.feature.ndjson +12 -12
- data/features/pending/pending.feature.rb +4 -4
- data/features/retry/retry.feature +7 -8
- data/features/retry/retry.feature.ndjson +14 -14
- data/features/retry/retry.feature.rb +3 -7
- data/features/rules/rules.feature +23 -21
- data/features/rules/rules.feature.ndjson +46 -44
- data/features/rules/rules.feature.rb +12 -15
- data/features/skipped/skipped.feature.ndjson +1 -1
- data/features/stack-traces/stack-traces.feature.ndjson +1 -1
- data/features/undefined/undefined.feature.ndjson +1 -1
- data/features/unknown-parameter-type/unknown-parameter-type.feature.ndjson +1 -1
- data/lib/cck/messages_comparator.rb +11 -11
- data/lib/cucumber/cucumber-compatibility-kit.rb +35 -37
- data/lib/cucumber-compatibility-kit.rb +2 -0
- data/lib/keys_checker.rb +2 -0
- data/lib/messages_comparator.rb +2 -0
- data/lib/shared_examples.rb +2 -2
- data/spec/cck/messages_comparator_spec.rb +2 -2
- data/spec/cucumber/cucumber-compatibility-kit_spec.rb +15 -15
- metadata +4 -3
@@ -7,16 +7,12 @@ module CCK
|
|
7
7
|
class MessagesComparator
|
8
8
|
include Helpers
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@all_errors = []
|
12
|
-
@compared = []
|
13
|
-
@validator = validator
|
14
|
-
|
10
|
+
def initialize(detected, expected)
|
15
11
|
compare(detected, expected)
|
16
12
|
end
|
17
13
|
|
18
14
|
def errors
|
19
|
-
|
15
|
+
all_errors.flatten
|
20
16
|
end
|
21
17
|
|
22
18
|
private
|
@@ -25,10 +21,10 @@ module CCK
|
|
25
21
|
detected_by_type = messages_by_type(detected)
|
26
22
|
expected_by_type = messages_by_type(expected)
|
27
23
|
|
28
|
-
detected_by_type.
|
24
|
+
detected_by_type.each_key do |type|
|
29
25
|
compare_list(detected_by_type[type], expected_by_type[type])
|
30
26
|
rescue StandardError => e
|
31
|
-
|
27
|
+
all_errors << "Error while comparing #{type}: #{e.message}"
|
32
28
|
end
|
33
29
|
end
|
34
30
|
|
@@ -55,8 +51,7 @@ module CCK
|
|
55
51
|
return if ignorable?(detected)
|
56
52
|
return if incomparable?(detected)
|
57
53
|
|
58
|
-
|
59
|
-
@compared << detected.class.name
|
54
|
+
all_errors << CCK::KeysChecker.compare(detected, expected)
|
60
55
|
compare_sub_messages(detected, expected)
|
61
56
|
end
|
62
57
|
|
@@ -84,7 +79,8 @@ module CCK
|
|
84
79
|
|
85
80
|
def compare_sub_messages(detected, expected)
|
86
81
|
return unless expected.respond_to? :to_h
|
87
|
-
|
82
|
+
|
83
|
+
expected.to_h.each_key do |key|
|
88
84
|
value = expected.send(key)
|
89
85
|
if value.is_a?(Array)
|
90
86
|
compare_list(detected.send(key), value)
|
@@ -93,5 +89,9 @@ module CCK
|
|
93
89
|
end
|
94
90
|
end
|
95
91
|
end
|
92
|
+
|
93
|
+
def all_errors
|
94
|
+
@all_errors ||= []
|
95
|
+
end
|
96
96
|
end
|
97
97
|
end
|
@@ -2,56 +2,54 @@
|
|
2
2
|
|
3
3
|
require 'shared_examples'
|
4
4
|
|
5
|
-
module Cucumber
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
module Cucumber
|
6
|
+
module CompatibilityKit
|
7
|
+
class << self
|
8
|
+
def all_examples
|
9
|
+
gherkin_examples + markdown_examples
|
10
|
+
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
.select do |file|
|
15
|
-
folder = File.join(examples_path, file)
|
12
|
+
def gherkin_examples
|
13
|
+
Dir.entries(examples_path).select do |file_or_folder|
|
14
|
+
next if file_or_folder.start_with?('.')
|
16
15
|
|
17
|
-
|
18
|
-
File.directory?(folder) &&
|
19
|
-
gherkin_example?(folder)
|
16
|
+
gherkin_example?(File.join(examples_path, file_or_folder))
|
20
17
|
end
|
21
|
-
|
18
|
+
end
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
.select do |file|
|
27
|
-
folder = File.join(examples_path, file)
|
20
|
+
def markdown_examples
|
21
|
+
Dir.entries(examples_path).select do |file_or_folder|
|
22
|
+
next if file_or_folder.start_with?('.')
|
28
23
|
|
29
|
-
|
30
|
-
|
31
|
-
markdown_example?(folder)
|
24
|
+
markdown_example?(File.join(examples_path, file_or_folder))
|
25
|
+
end
|
32
26
|
end
|
33
|
-
end
|
34
27
|
|
35
|
-
|
36
|
-
|
37
|
-
|
28
|
+
def examples_path
|
29
|
+
File.expand_path("#{File.dirname(__FILE__)}/../../features/")
|
30
|
+
end
|
38
31
|
|
39
|
-
|
40
|
-
|
32
|
+
def example_path(example_name)
|
33
|
+
path = File.join(examples_path, example_name)
|
41
34
|
|
42
|
-
|
35
|
+
return path if File.directory?(path)
|
43
36
|
|
44
|
-
|
45
|
-
|
37
|
+
raise ArgumentError, "No CCK example exists for #{example_name}"
|
38
|
+
end
|
46
39
|
|
47
|
-
|
40
|
+
private
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
def gherkin_example?(example_folder)
|
43
|
+
file_type_in_folder?('.feature', example_folder)
|
44
|
+
end
|
52
45
|
|
53
|
-
|
54
|
-
|
46
|
+
def markdown_example?(example_folder)
|
47
|
+
file_type_in_folder?('.md', example_folder)
|
48
|
+
end
|
49
|
+
|
50
|
+
def file_type_in_folder?(extension, folder)
|
51
|
+
Dir.entries(folder).any? { |file| File.extname(file) == extension }
|
52
|
+
end
|
55
53
|
end
|
56
54
|
end
|
57
55
|
end
|
data/lib/keys_checker.rb
CHANGED
data/lib/messages_comparator.rb
CHANGED
data/lib/shared_examples.rb
CHANGED
@@ -10,7 +10,7 @@ require 'keys_checker'
|
|
10
10
|
RSpec.shared_examples 'cucumber compatibility kit' do
|
11
11
|
include CCK::Helpers
|
12
12
|
|
13
|
-
#
|
13
|
+
# NOTE: to use those examples, you need to define:
|
14
14
|
# let(:example) { } # the name of the example to test
|
15
15
|
# let(:messages) { } # the messages to validate
|
16
16
|
|
@@ -30,7 +30,7 @@ RSpec.shared_examples 'cucumber compatibility kit' do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'generates valid message structure' do
|
33
|
-
comparator = CCK::MessagesComparator.new(
|
33
|
+
comparator = CCK::MessagesComparator.new(parsed_generated, parsed_original)
|
34
34
|
|
35
35
|
expect(comparator.errors).to be_empty, "There were comparison errors: #{comparator.errors}"
|
36
36
|
end
|
@@ -15,13 +15,13 @@ describe CCK::MessagesComparator do
|
|
15
15
|
let(:meta_message_envelope) { Cucumber::Messages::Envelope.new(meta: blank_meta_message) }
|
16
16
|
|
17
17
|
it 'ignores any detected CI messages' do
|
18
|
-
comparator = described_class.new(
|
18
|
+
comparator = described_class.new([ci_message_envelope], [meta_message_envelope])
|
19
19
|
|
20
20
|
expect(comparator.errors).to be_empty
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'ignores any expected CI messages' do
|
24
|
-
comparator = described_class.new(
|
24
|
+
comparator = described_class.new([meta_message_envelope], [ci_message_envelope])
|
25
25
|
|
26
26
|
expect(comparator.errors).to be_empty
|
27
27
|
end
|
@@ -5,21 +5,21 @@ require 'cucumber-compatibility-kit'
|
|
5
5
|
describe Cucumber::CompatibilityKit do
|
6
6
|
let(:features_path) { File.expand_path("#{File.dirname(__FILE__)}/../../features") }
|
7
7
|
let(:gherkin_examples) do
|
8
|
-
[
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
8
|
+
%w[
|
9
|
+
attachments
|
10
|
+
cdata
|
11
|
+
data-tables
|
12
|
+
examples-tables
|
13
|
+
hooks
|
14
|
+
minimal
|
15
|
+
parameter-types
|
16
|
+
pending
|
17
|
+
retry
|
18
|
+
rules
|
19
|
+
skipped
|
20
|
+
stack-traces
|
21
|
+
undefined
|
22
|
+
unknown-parameter-type
|
23
23
|
]
|
24
24
|
end
|
25
25
|
let(:markdown_examples) { ['markdown'] }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-compatibility-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 14.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurélien Reeves
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-
|
14
|
+
date: 2023-11-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: cucumber-messages
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- features/attachments/document.pdf
|
139
139
|
- features/cdata/cdata.feature
|
140
140
|
- features/cdata/cdata.feature.ndjson
|
141
|
+
- features/cdata/cdata.feature.rb
|
141
142
|
- features/data-tables/data-tables.feature
|
142
143
|
- features/data-tables/data-tables.feature.ndjson
|
143
144
|
- features/data-tables/data-tables.feature.rb
|
@@ -217,7 +218,7 @@ requirements: []
|
|
217
218
|
rubygems_version: 3.4.10
|
218
219
|
signing_key:
|
219
220
|
specification_version: 4
|
220
|
-
summary: cucumber-compatibility-kit-
|
221
|
+
summary: cucumber-compatibility-kit-14.0.0
|
221
222
|
test_files:
|
222
223
|
- spec/cck/keys_checker_spec.rb
|
223
224
|
- spec/cck/messages_comparator_spec.rb
|