Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wnuqui
Copy link

@wnuqui wnuqui commented Jul 6, 2017

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

Before

before

After

after

Please review, thanks!

_parse_summary(results.summary)

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

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
Copy link

coveralls commented Jul 6, 2017

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
Copy link

coveralls commented Jul 6, 2017

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

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.

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

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
Copy link

coveralls commented Jul 6, 2017

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

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.

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

Choose a reason for hiding this comment

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

Use // around regular expression.

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

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.

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

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
Copy link

coveralls commented Jul 6, 2017

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
Copy link

coveralls commented Jul 6, 2017

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

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
Copy link

coveralls commented Jul 7, 2017

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

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
Copy link

sebakri commented Oct 21, 2017

👍

@swrobel
Copy link

swrobel commented Apr 19, 2018

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

@ardenzhan
Copy link

👍

1 similar comment
@jkubacki
Copy link

👍

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