-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from 907th/respect_guard_notifier
Respect guard notifier + Many more refactorings
- Loading branch information
Showing
32 changed files
with
999 additions
and
474 deletions.
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 |
---|---|---|
|
@@ -6,3 +6,5 @@ pkg/* | |
.rbx/* | ||
Gemfile.lock | ||
coverage/ | ||
.ruby-version | ||
.ruby-gemset |
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
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
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
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
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,36 @@ | ||
require 'rspec/core/formatters/base_formatter' | ||
|
||
module Guard | ||
class RSpec | ||
class Formatter < ::RSpec::Core::Formatters::BaseFormatter | ||
TEMPORARY_FILE_PATH = './tmp/rspec_guard_result' | ||
|
||
# Write summary to temporary file for runner | ||
def dump_summary(duration, total, failures, pending) | ||
FileUtils.mkdir_p('tmp') | ||
File.open(TEMPORARY_FILE_PATH, 'w') do |f| | ||
f.puts _message(total, failures, pending, duration) | ||
f.puts _failed_paths.join("\n") if failures > 0 | ||
end | ||
rescue | ||
# nothing really we can do, at least don't kill the test runner | ||
end | ||
|
||
private | ||
|
||
def _failed_paths | ||
failed = examples.select { |e| e.execution_result[:status] == 'failed' } | ||
failed.map { |e| e.metadata[:location] } | ||
end | ||
|
||
def _message(example_count, failure_count, pending_count, duration) | ||
message = "#{example_count} examples, #{failure_count} failures" | ||
if pending_count > 0 | ||
message << " (#{pending_count} pending)" | ||
end | ||
message << " in #{duration.round(4)} seconds" | ||
message | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.