Skip to content

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

Open
wnuqui wants to merge 1 commit intoguard: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 intoguard:masterfrom
wnuqui:fix/notify-that-there-is-error-and-examples-are-not-run

Conversation

@wnuqui
Copy link
Copy Markdown

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

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

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

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

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

# 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.

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.

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

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

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

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

sebakri commented Oct 21, 2017

👍

@swrobel
Copy link
Copy Markdown

swrobel commented Apr 19, 2018

@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