rspec / rspec-support

Common code needed by the other RSpec gems. Not intended for direct use.
https://rspec.info
MIT License
96 stars 104 forks source link

Switch rspec local data to a thread accessor #610

Open JonRowe opened 1 month ago

JonRowe commented 1 month ago

Originally suggested to fix #580 I turned this down because of waryness over patching thread, but given the conversation about mocking in #605 and #606 I think this is a better solution than capturing methods and other overly complicated solutions.

Additionally we patch in an alias for Thread.current to protect access to that when mocked.