Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch rspec local data to a thread accessor #610

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Jul 17, 2024

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.

lib/rspec/support.rb Outdated Show resolved Hide resolved
Copy link

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@JonRowe JonRowe force-pushed the switch-thread-local-data-to-local-attr branch from 1db709e to 29ab2de Compare July 18, 2024 08:57
@JonRowe JonRowe force-pushed the switch-thread-local-data-to-local-attr branch from 4aab9b5 to ea68723 Compare September 7, 2024 11:34
@JonRowe JonRowe force-pushed the switch-thread-local-data-to-local-attr branch from ea68723 to 4170844 Compare September 8, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

This is not thread local, it is in fact fiber local.
2 participants