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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Present the actual error message from raise_error #1330

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

Conversation

genehsu
Copy link

@genehsu genehsu commented Oct 27, 2021

Fixes #1190

Display the actual error message of the raised error when a raise_error
assertion fails. The failure message will now include the error message
on a separate line followed by the backtrace. If there is no error
message, only the backtrace will be shown.

If this approach is not correct, then please close this PR without prejudice 馃槂

Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this, can you check out these couple of suggestions?

spec/rspec/matchers/built_in/raise_error_spec.rb Outdated Show resolved Hide resolved
lib/rspec/matchers/built_in/raise_error.rb Outdated Show resolved Hide resolved
Display the actual error message of the raised error when a raise_error
asserton fails.  The failure message will now include the error message
on a separate line followed by the backtrace.  If there is no error
message, only the backtrace will be shown.
@genehsu genehsu force-pushed the genehsu/add-message-to-raise_error-failure-output branch from c3d0c74 to c1ddbf5 Compare November 3, 2021 17:40
@genehsu
Copy link
Author

genehsu commented Nov 3, 2021

@JonRowe

Thanks for tackling this, can you check out these couple of suggestions?

Thanks for the review. I believe I've addressed your suggestions with clearer code. Let me know if you have any other suggestions to the code or output.

@genehsu genehsu requested a review from JonRowe November 16, 2021 04:43
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.

Allow configuring exceptions raise_error should capture to display webmock errors correctly
2 participants