- Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
When Mock.install_method aliases an existing method (https://github.com/ruby/mspec/blob/master/lib/mspec/mocks/mock.rb#L63), it does so using a symbol that is unique (it has the #object_id). And since that symbol is used as method, even if the method gets erased, the symbol remains.
This means that if a spec was to run multiple time (ex, using repeat), or some custom made mechanism, specs using Mock.install_method appear to have a memory leak (They technically do).
If those names were instead reused, such as by incrementing from 1, storing the number, and then on clenaup, resetting to 1, the leaky side of this would be removed.
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels