cucumber-compatibility-kit 20.1.0 → 22.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/README.md +5 -5
- data/features/ambiguous/ambiguous.feature +6 -0
- data/features/ambiguous/ambiguous.ndjson +13 -0
- data/features/attachments/attachments.ndjson +34 -34
- data/features/backgrounds/backgrounds.feature +17 -0
- data/features/backgrounds/backgrounds.ndjson +36 -0
- data/features/doc-strings/doc-strings.feature +31 -0
- data/features/doc-strings/doc-strings.ndjson +24 -0
- data/features/examples-tables-attachment/examples-tables-attachment.ndjson +9 -9
- data/features/global-hooks/global-hooks.feature +10 -0
- data/features/global-hooks/global-hooks.ndjson +31 -0
- data/features/global-hooks-afterall-error/global-hooks-afterall-error.feature +6 -0
- data/features/global-hooks-afterall-error/global-hooks-afterall-error.ndjson +27 -0
- data/features/global-hooks-attachments/global-hooks-attachments.feature +5 -0
- data/features/global-hooks-attachments/global-hooks-attachments.ndjson +20 -0
- data/features/global-hooks-beforeall-error/global-hooks-beforeall-error.feature +6 -0
- data/features/global-hooks-beforeall-error/global-hooks-beforeall-error.ndjson +22 -0
- data/features/hooks-attachment/hooks-attachment.ndjson +9 -9
- data/features/markdown/markdown.ndjson +17 -17
- data/features/multiple-features/multiple-features-1.feature +10 -0
- data/features/multiple-features/multiple-features-2.feature +10 -0
- data/features/multiple-features/multiple-features-3.feature +10 -0
- data/features/multiple-features/multiple-features.ndjson +64 -0
- data/features/multiple-features-reversed/multiple-features-reversed-1.feature +10 -0
- data/features/multiple-features-reversed/multiple-features-reversed-2.feature +10 -0
- data/features/multiple-features-reversed/multiple-features-reversed-3.feature +10 -0
- data/features/multiple-features-reversed/multiple-features-reversed.arguments.txt +1 -0
- data/features/multiple-features-reversed/multiple-features-reversed.ndjson +64 -0
- data/features/regular-expression/regular-expression.feature +9 -0
- data/features/regular-expression/regular-expression.ndjson +16 -0
- data/features/retry/retry.feature +6 -0
- data/features/retry/retry.ndjson +73 -58
- data/features/rules-backgrounds/rules-backgrounds.feature +23 -0
- data/features/rules-backgrounds/rules-backgrounds.ndjson +44 -0
- data/features/unused-steps/unused-steps.feature +6 -0
- data/features/unused-steps/unused-steps.ndjson +13 -0
- data/lib/cucumber/compatibility_kit.rb +55 -0
- metadata +39 -13
- data/lib/cck/examples.rb +0 -58
data/lib/cck/examples.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module CCK
|
4
|
-
# CCK::Examples
|
5
|
-
# The helper methods to determine the paths for each relevant item
|
6
|
-
module Examples
|
7
|
-
class << self
|
8
|
-
# Return the paths for each example that is of 'gherkin' type
|
9
|
-
def gherkin
|
10
|
-
Dir.entries(cck_features_folder_location).select do |file_or_folder|
|
11
|
-
next if file_or_folder.start_with?('.')
|
12
|
-
|
13
|
-
gherkin_example?(File.join(cck_features_folder_location, file_or_folder))
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
# Return the paths for each example that is of 'markdown' type
|
18
|
-
# NB: At the moment this (1 example - 'markdown'), isn't compatible with cucumber-ruby
|
19
|
-
def markdown
|
20
|
-
Dir.entries(cck_features_folder_location).select do |file_or_folder|
|
21
|
-
next if file_or_folder.start_with?('.')
|
22
|
-
|
23
|
-
markdown_example?(File.join(cck_features_folder_location, file_or_folder))
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# Return the path for a specific example scenario based on its name
|
28
|
-
#
|
29
|
-
# i.e. 'attachments' would return the fully qualified path to the attachments folder
|
30
|
-
# which contains the feature, the ndjson file and any applicable assets to run the example
|
31
|
-
def feature_code_for(example_name)
|
32
|
-
path = File.join(cck_features_folder_location, example_name)
|
33
|
-
|
34
|
-
return path if File.directory?(path)
|
35
|
-
|
36
|
-
raise ArgumentError, "No feature code directory found in gem for CCK example: #{example_name}"
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
|
41
|
-
def cck_features_folder_location
|
42
|
-
File.expand_path("#{File.dirname(__FILE__)}/../../features/")
|
43
|
-
end
|
44
|
-
|
45
|
-
def gherkin_example?(example_folder)
|
46
|
-
file_type_in_folder?('.feature', example_folder)
|
47
|
-
end
|
48
|
-
|
49
|
-
def markdown_example?(example_folder)
|
50
|
-
file_type_in_folder?('.md', example_folder)
|
51
|
-
end
|
52
|
-
|
53
|
-
def file_type_in_folder?(extension, folder)
|
54
|
-
Dir.entries(folder).any? { |file| File.extname(file) == extension }
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|