-
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't overflow stack if method expectation for #respond_to? fails
In the process of generating the error message for a failed method expectation, ErrorGenerator would call Array#join on an array which contained the receiver. Internally, Array#join calls #respond_to?(:to_str) on the objects which are being joined into a string. If the method expectation was for #respond_to?, the internal call to #respond_to? could cause the expectation to fail again, causing an infinite loop and resulting stack overflow. Avoid this by not using Array#join to generate the error message. Fixes #1020.
- Loading branch information
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters