-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate passing block to mock object constructor
This mechanism is confusing, because the block is evaluated in the context of the newly instantiated block and not in the context of the current test. The mechanism is also of dubious value, because it's possible to use Object#tap or define stubs/expectations with the mock object as the explicit receiver without the code becoming much more verbose. It's unfortunate that the deprecations make the tests more complicated, but we will be able to simplify them again when this functionality is removed in a later version. See #286 for further details.
- Loading branch information
1 parent
2e67044
commit 706286d
Showing
5 changed files
with
43 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ def disable_deprecations | |
end | ||
end | ||
|
||
module_function :disable_deprecations | ||
end |
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