Class: Cucumber::Configuration
- Inherits:
-
Object
- Object
- Cucumber::Configuration
show all
- Extended by:
- Forwardable
- Includes:
- Constantize
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb
Overview
The base class for configuring settings for a Cucumber run.
Class Method Summary
collapse
Instance Method Summary
collapse
#constantize, #underscore
Constructor Details
#initialize(user_options = {}) ⇒ Configuration
Returns a new instance of Configuration.
37
38
39
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 37
def initialize(user_options = {})
@options = default_options.merge(Hash(user_options))
end
|
Class Method Details
18
19
20
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 18
def self.default
new
end
|
Instance Method Details
#all_files_to_load ⇒ Object
189
190
191
192
193
194
195
196
197
198
199
200
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 189
def all_files_to_load
files = require_dirs.map do |path|
path = path.tr('\\', '/') path = path.gsub(/\/$/, '') File.directory?(path) ? Dir["#{path}/**/*"] : path
end.flatten.uniq
remove_excluded_files_from(files)
files.select! { |f| File.file?(f) }
files.reject! { |f| File.extname(f) == '.feature' }
files.reject! { |f| f =~ /^http/ }
files.sort
end
|
#autoload_code_paths ⇒ Object
129
130
131
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 129
def autoload_code_paths
@options[:autoload_code_paths]
end
|
#custom_profiles ⇒ Object
117
118
119
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 117
def custom_profiles
profiles - [@options[:default_profile]]
end
|
#dry_run? ⇒ Boolean
61
62
63
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 61
def dry_run?
@options[:dry_run]
end
|
#duration? ⇒ Boolean
101
102
103
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 101
def duration?
@options[:duration]
end
|
#error_stream ⇒ Object
49
50
51
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 49
def error_stream
@options[:error_stream]
end
|
#event_bus ⇒ Object
248
249
250
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 248
def event_bus
@options[:event_bus]
end
|
#expand? ⇒ Boolean
93
94
95
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 93
def expand?
@options[:expand]
end
|
#fail_fast? ⇒ Boolean
73
74
75
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 73
def fail_fast?
@options[:fail_fast]
end
|
#feature_dirs ⇒ Object
137
138
139
140
141
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 137
def feature_dirs
dirs = paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq
dirs.delete('.') unless paths.include?('.')
with_default_features_path(dirs)
end
|
#feature_files ⇒ Object
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 159
def feature_files
potential_feature_files = with_default_features_path(paths).map do |path|
path = path.tr('\\', '/') path = path.chomp('/')
if File.directory?(path)
Dir["#{path}/**/*.feature"].sort
elsif Cli::RerunFile.can_read?(path)
Cli::RerunFile.new(path).features
else
path
end
end.flatten.uniq
remove_excluded_files_from(potential_feature_files)
potential_feature_files
end
|
155
156
157
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 155
def filters
@options[:filters]
end
|
125
126
127
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 125
def formats
@options[:formats]
end
|
217
218
219
220
221
222
223
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 217
def formatter_class(format)
if (builtin = Cli::Options::BUILTIN_FORMATS[format])
constantize(builtin[0])
else
constantize(format)
end
end
|
206
207
208
209
210
211
212
213
214
215
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 206
def formatter_factories
formats.map do |format, formatter_options, path_or_io|
factory = formatter_class(format)
yield factory,
formatter_options,
path_or_io
rescue Exception => e raise e, "#{e.message}\nError creating formatter: #{format}", e.backtrace
end
end
|
#guess? ⇒ Boolean
81
82
83
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 81
def guess?
@options[:guess]
end
|
#id_generator ⇒ Object
252
253
254
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 252
def id_generator
@id_generator ||= Cucumber::Messages::IdGenerator::UUID.new
end
|
#name_regexps ⇒ Object
151
152
153
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 151
def name_regexps
@options[:name_regexps]
end
|
#notify(message, *args) ⇒ Object
33
34
35
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 33
def notify(message, *args)
event_bus.send(message, *args)
end
|
#on_event {|Object| ... } ⇒ Object
Subscribe to an event.
See Events for the list of possible events.
30
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 30
def_instance_delegator :event_bus, :on, :on_event
|
#out_stream ⇒ Object
45
46
47
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 45
def out_stream
@options[:out_stream]
end
|
121
122
123
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 121
def paths
@options[:paths]
end
|
113
114
115
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 113
def profiles
@options[:profiles] || []
end
|
#publish_enabled? ⇒ Boolean
65
66
67
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 65
def publish_enabled?
@options[:publish_enabled]
end
|
#publish_quiet? ⇒ Boolean
69
70
71
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 69
def publish_quiet?
@options[:publish_quiet]
end
|
#randomize? ⇒ Boolean
53
54
55
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 53
def randomize?
@options[:order] == 'random'
end
|
#register_snippet_generator(generator) ⇒ Object
243
244
245
246
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 243
def register_snippet_generator(generator)
snippet_generators << generator
self
end
|
#retry_attempts ⇒ Object
77
78
79
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 77
def retry_attempts
@options[:retry]
end
|
57
58
59
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 57
def seed
@options[:seed]
end
|
109
110
111
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 109
def skip_profile_information?
@options[:skip_profile_information]
end
|
#snippet_generators ⇒ Object
An array of procs that can generate snippets for undefined steps. These procs may be called if a formatter wants to display snippets to the user.
Each proc should take the following arguments:
- keyword
- step text
- multiline argument
- snippet type
239
240
241
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 239
def snippet_generators
@options[:snippet_generators] ||= []
end
|
#snippet_type ⇒ Object
133
134
135
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 133
def snippet_type
@options[:snippet_type]
end
|
#snippets? ⇒ Boolean
105
106
107
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 105
def snippets?
@options[:snippets]
end
|
#source? ⇒ Boolean
97
98
99
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 97
def source?
@options[:source]
end
|
#step_defs_to_load ⇒ Object
202
203
204
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 202
def step_defs_to_load
all_files_to_load.reject { |f| f =~ /\/support\// }
end
|
85
86
87
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 85
def strict
@options[:strict]
end
|
#support_to_load ⇒ Object
178
179
180
181
182
183
184
185
186
187
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 178
def support_to_load
support_files = all_files_to_load.select { |f| f =~ /\/support\// }
env_files = support_files.select { |f| f =~ /\/support\/env\..*/ }
other_files = support_files - env_files
env_files.reverse + other_files.reverse
end
|
#tag_expressions ⇒ Object
147
148
149
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 147
def tag_expressions
@options[:tag_expressions]
end
|
#tag_limits ⇒ Object
143
144
145
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 143
def tag_limits
@options[:tag_limits]
end
|
225
226
227
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 225
def to_hash
@options
end
|
#wip? ⇒ Boolean
89
90
91
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 89
def wip?
@options[:wip]
end
|
#with_options(new_options) ⇒ Object
41
42
43
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/configuration.rb', line 41
def with_options(new_options)
self.class.new(@options.merge(new_options))
end
|