-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notify user of error and that examples are not run #399
base: master
Are you sure you want to change the base?
Notify user of error and that examples are not run #399
Conversation
lib/guard/rspec/rspec_process.rb
Outdated
_parse_summary(results.summary) | ||
|
||
!all_green? && \ | ||
example_count == 0 && failure_count == 0 && pending_count == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use example_count.zero? instead of example_count == 0.
Use failure_count.zero? instead of failure_count == 0.
Use pending_count.zero? instead of pending_count == 0.
1 similar comment
spec/lib/guard/rspec/runner_spec.rb
Outdated
allow(process).to receive(:error_and_examples_not_run?).and_return(true) | ||
|
||
expect(notifier).to receive(:notify_failure) | ||
.with(/Error\/s occurred and examples are not run./) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %r around regular expression.
60d3319
to
f201035
Compare
spec/lib/guard/rspec/runner_spec.rb
Outdated
allow(process).to receive(:error_and_examples_not_run?).and_return(true) | ||
|
||
expect(notifier).to receive(:notify_failure) | ||
.with(/Error\/s occurred and examples are not run./) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %r around regular expression.
lib/guard/rspec/rspec_process.rb
Outdated
# Returns true if there is an error AND examples are not run. | ||
def error_and_examples_not_run? | ||
error = "error occurred outside of examples" | ||
summary_regexp = %r{0 examples, 0 failures( \((\d+) #{error}\))?} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use // around regular expression.
spec/lib/guard/rspec/runner_spec.rb
Outdated
allow(process).to receive(:error_and_examples_not_run?).and_return(true) | ||
|
||
expect(notifier).to receive(:notify_failure) | ||
.with(/Error\/s occurred and examples are not run./) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %r around regular expression.
lib/guard/rspec/rspec_process.rb
Outdated
# Returns true if there is an error AND examples are not run. | ||
def error_and_examples_not_run? | ||
error = "error occurred outside of examples" | ||
summary_regexp = %r{0 examples, 0 failures( \((\d+) #{error}\))?} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use // around regular expression.
f201035
to
b5cce3e
Compare
1 similar comment
b5cce3e
to
7a2fd06
Compare
1 similar comment
👍 |
@e2 are you still the maintainer? if so, please review & merge! |
👍 |
1 similar comment
👍 |
Fixes #398, now user is correctly notified of error and that examples are not run.
Before
After
Please review, thanks!