Skip to content

Notify user of error and that examples are not run - #399

Open
wnuqui wants to merge 1 commit into
guard:masterfrom
wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run
Open

Notify user of error and that examples are not run#399
wnuqui wants to merge 1 commit into
guard:masterfrom
wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run

Conversation

@wnuqui

@wnuqui wnuqui commented Jul 6, 2017

Copy link
Copy Markdown

Fixes #398, now user is correctly notified of error and that examples are not run.

Before

before

After

after

Please review, thanks!

Comment thread lib/guard/rspec/rspec_process.rb Outdated
_parse_summary(results.summary)

!all_green? && \
example_count == 0 && failure_count == 0 && pending_count == 0

Copy link
Copy Markdown

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.

@coveralls

coveralls commented Jul 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 97.712% when pulling 47d7387 on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

@coveralls

coveralls commented Jul 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 97.712% when pulling 33cbd1d on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.5%) to 97.712% when pulling 33cbd1d on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

Comment thread 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./)

Copy link
Copy Markdown

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.

@wnuqui wnuqui changed the title Notify user of error and that examples are not run (fixes #398) Notify user of error and that examples are not run Jul 6, 2017
@coveralls

coveralls commented Jul 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.1%) to 98.13% when pulling 60d3319 on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

@wnuqui
wnuqui force-pushed the fix/notify-that-there-is-error-and-examples-are-not-run branch from 60d3319 to f201035 Compare July 6, 2017 23:34
Comment thread 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./)

Copy link
Copy Markdown

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.

Comment thread 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}\))?}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use // around regular expression.

Comment thread 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./)

Copy link
Copy Markdown

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.

Comment thread 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}\))?}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use // around regular expression.

@coveralls

coveralls commented Jul 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.263% when pulling f201035 on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

@wnuqui
wnuqui force-pushed the fix/notify-that-there-is-error-and-examples-are-not-run branch from f201035 to b5cce3e Compare July 6, 2017 23:41
@coveralls

coveralls commented Jul 6, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.263% when pulling b5cce3e on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.263% when pulling b5cce3e on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

@wnuqui
wnuqui force-pushed the fix/notify-that-there-is-error-and-examples-are-not-run branch from b5cce3e to 7a2fd06 Compare July 7, 2017 08:31
@coveralls

coveralls commented Jul 7, 2017

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.263% when pulling 7a2fd06 on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 98.263% when pulling 7a2fd06 on wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run into 1cf25c7 on guard:master.

@sebakri

sebakri commented Oct 21, 2017

Copy link
Copy Markdown

👍

@swrobel

swrobel commented Apr 19, 2018

Copy link
Copy Markdown

@e2 are you still the maintainer? if so, please review & merge!

@ardenzhan

Copy link
Copy Markdown

👍

1 similar comment
@jkubacki

Copy link
Copy Markdown

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants