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

Fix error message of assert_raise #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

britishtea
Copy link
Contributor

Since commit f6b140c assert_raise started using the second argument of assert for error messages. The error message was always "got nil instead". The reason is that the local variable exception only has a value in case of success. In case of failure its value is nil.

This pull request adds a test for the error message of each assertion method (assert, assert_equal and assert_raise) and fixes assert_raise to construct the expected error message in case of failure.

Jip van Reijsen added 3 commits April 26, 2016 10:14
Since commit f6b140c assert_raise started using the second argument of assert
for error messages. The error message was always "got nil instead". The reason
is that the local variable "exception" only has a value in case of success. In
case of failure its value is nil.

This commit adds tests to catch the error and fixes assert_raise to construct
the expected error message in case of failure.
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.

1 participant