-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix frozen string literal warning in InstanceMethod
I've mostly fixed this by using `Object.new` instead of instances of `String` to act as partial mocks. I've also had to disable one test which is specifically stubbing a method on an instance of `String` when the Ruby version is v3.4 or higher. This is OK, because we already have behaviour in place to prevent stubbing of a method on a frozen object [1,2], so the behaviour under test would be moot at that point. Previously I was seeing a lot of the following warnings when running the tests under Ruby v3.4: lib/mocha/instance_method.rb:16: warning: literal string will be frozen in the future [1]: https://github.com/freerange/mocha/blob/5c7d14cb7d779bd22da3dbfe9d16ed1091ace7a1/lib/mocha/object_methods.rb#L75-L77 [2]: https://github.com/freerange/mocha/blob/5c7d14cb7d779bd22da3dbfe9d16ed1091ace7a1/lib/mocha/object_methods.rb#L121-L123
- Loading branch information
1 parent
55dd0fc
commit ce2ae26
Showing
4 changed files
with
18 additions
and
16 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