Skip to content

Removes #to_str implementation from test_double

gitlab-qa-bot requested to merge github/fork/mauricio/issue-567 into master

Created by: mauricio

Having test_double implement to_str makes the Ruby runtime coerce it to a string whenever needed and this isn't the intended behaviour for this object. This behaviour led to issue #567 (closed) as Ruby will try to coerce the exception object into string when raising ( here ) an exception and since test_double does implement to_str it is coerced to string and raised instead of failing with the correct 'this is not an exception object' error.

This fixes #567 (closed) by providing a better error message in it's case.

Merge request reports