[rspec-mocks] `and_call_original` doesn't properly verify arguments from initialize when stubbing new
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 117
- Forks
- 51
- Avg merge
- 59m
- Merged PRs (30d)
- 3
Description
and_call_original doesn't properly verify arguments from initialize when stubbing new
From rspec/rspec-support#419:
We added support for new => initialize for verifying doubles, and_call_original never got support for it, we would need to support it there. You need to check that the method is the original implementation and not a custom def self.new which is very common, and a few other things, so I'd much rather have that logic in mocks atm.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading rspec/rspec-support#419 and tracing how rspec-mocks handles and_call_original when stubbing new. Determine how to verify initialize arguments only for the original implementation, while accounting for custom self.new methods. Done means the relevant argument verification works without applying to custom constructors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100