-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a private reference to JSON.parse to prevent it being mocked
PIE-979 It is possible for test suites to mock the parse method of JSON. For example: allow(JSON).to receive(:parse).and_raise(JSON::ParserError) This will cause the test collector library to misbehave. We can resolve this problem by updating the test collector code to use a private reference to the JSON method which is immune to mocking. This solution is similar to #132 and https://github.com/ruby/timeout/pull/18/files Resolves #144
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
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