-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FailureListFormatter that outputs failures to log/rspec-failures.log
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/usr/bin/env ruby | ||
require 'rspec_queue/server_runner' | ||
require 'rspec_queue/formatter' | ||
require 'rspec_queue/failure_list_formatter' | ||
|
||
ENV['SPEC_OPTS'] = "--format RSpecQueue::Formatter" unless ENV['SPEC_OPTS'] | ||
ENV['SPEC_OPTS'] = "--format RSpecQueue::Formatter --format RSpecQueue::FailureListFormatter --out log/rspec-failures.log" unless ENV['SPEC_OPTS'] | ||
RSpecQueue::ServerRunner.invoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
require 'rspec_queue/worker_runner' | ||
require 'rspec_queue/formatter' | ||
require 'rspec_queue/failure_list_formatter' | ||
|
||
RSpecQueue::WorkerRunner.invoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rspec/core/formatters' | ||
|
||
module RSpecQueue | ||
# Taken from rspec-core 3.9.0.pre FailureListFormatter | ||
class FailureListFormatter < RSpec::Core::Formatters::BaseFormatter | ||
RSpec::Core::Formatters.register self, :example_failed, :dump_profile, :message | ||
|
||
def example_failed(failure) | ||
output.puts "#{failure.example.location}:#{failure.example.description}" | ||
end | ||
|
||
# Discard profile and messages | ||
# | ||
# These outputs are not really relevant in the context of this failure | ||
# list formatter. | ||
def dump_profile(_profile); end | ||
def message(_message); end | ||
end | ||
end |