lib/onceover/rspec/formatters.rb in onceover-3.15.2 vs lib/onceover/rspec/formatters.rb in onceover-3.16.0
- old
+ new
@@ -1,11 +1,17 @@
require 'rspec'
require 'pathname'
class OnceoverFormatter
- RSpec::Core::Formatters.register self, :example_group_started,
- :example_passed, :example_failed, :example_pending, :dump_failures#, :dump_summary
+ RSpec::Core::Formatters.register(
+ self,
+ :example_group_started,
+ :example_passed,
+ :example_failed,
+ :example_pending,
+ :dump_failures,
+ )
COMPILATION_ERROR = %r{error during compilation: (?<error>.*)}
ERROR_WITH_LOCATION = %r{(?<error>.*?)\s(at )?(\((file: (?<file>.*?), )?line: (?<line>\d+)(, column: (?<column>\d+))?\))(; )?}
ERROR_WITHOUT_LOCATION = %r{(?<error>.*?)\son node}
@@ -216,12 +222,18 @@
end
class OnceoverFormatterParallel < OnceoverFormatter
require 'yaml'
- RSpec::Core::Formatters.register self, :example_group_started,
- :example_passed, :example_failed, :example_pending, :dump_failures
+ RSpec::Core::Formatters.register(
+ self,
+ :example_group_started,
+ :example_passed,
+ :example_failed,
+ :example_pending,
+ :dump_failures,
+ )
def example_group_started notification
# Do nothing
end
@@ -285,10 +297,10 @@
def initialize(output)
FileUtils.touch(File.expand_path("#{RSpec.configuration.onceover_tempdir}/failures.out"))
end
def dump_failures(failures)
- open(File.expand_path("#{RSpec.configuration.onceover_tempdir}/failures.out"), 'a') { |f|
+ File.open(File.expand_path("#{RSpec.configuration.onceover_tempdir}/failures.out"), 'a') { |f|
failures.failed_examples.each do |fe|
f.puts
f.puts "#{fe.metadata[:description]}"
f.puts "#{fe.metadata[:execution_result].exception.to_s}"
f.puts "#{fe.metadata[:file_path]}:#{fe.metadata[:line_number]}"
\ No newline at end of file