Class: OnceoverFormatterParallel
Constant Summary
OnceoverFormatter::COMPILATION_ERROR, OnceoverFormatter::ERROR_WITHOUT_LOCATION, OnceoverFormatter::ERROR_WITH_LOCATION
Instance Method Summary
collapse
#black, #blue, #bold, #calculate_relative_source, #class_name, #cyan, #extract_failure_data, #extract_failures, #green, #initialize, #longest_group, #magenta, #parse_errors, #red, #white, #yellow
Instance Method Details
#dump_failures(notification) ⇒ Object
259
260
261
262
263
264
265
266
267
268
269
|
# File 'lib/onceover/rspec/formatters.rb', line 259
def dump_failures notification
require 'securerandom'
random_string = SecureRandom.hex
FileUtils.mkdir_p "#{RSpec.configuration.onceover_tempdir}/parallel"
File.write("#{RSpec.configuration.onceover_tempdir}/parallel/results-#{random_string}.yaml", (notification).to_yaml)
end
|
#example_failed(notification) ⇒ Object
249
250
251
252
|
# File 'lib/onceover/rspec/formatters.rb', line 249
def example_failed notification
@output << red('F')
@output.flush
end
|
#example_group_started(notification) ⇒ Object
240
241
242
|
# File 'lib/onceover/rspec/formatters.rb', line 240
def example_group_started notification
end
|
#example_passed(notification) ⇒ Object
244
245
246
247
|
# File 'lib/onceover/rspec/formatters.rb', line 244
def example_passed notification
@output << green('P')
@output.flush
end
|
#example_pending(notification) ⇒ Object
254
255
256
257
|
# File 'lib/onceover/rspec/formatters.rb', line 254
def example_pending notification
@output << yellow('?')
@output.flush
end
|
#output_results(directory) ⇒ Object
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
# File 'lib/onceover/rspec/formatters.rb', line 271
def output_results(directory)
require 'rspec/core/example'
results = {}
files = Dir["#{directory}/*.yaml"]
roles = files.reduce({}) do |errs, file|
errs.merge(YAML.load_file(file)) {|key, oldval, newval| [oldval, newval].flatten }
end
files.each { |f| File.delete(f) }
@output << "\n\n\n"
roles.each do |name, errors|
@output << Onceover::Controlrepo.evaluate_template('error_summary.yaml.erb', binding)
end
@output << "\n"
end
|