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 5 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 added a commit that referenced this pull request Jul 18, 2024
@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 2 times, most recently from ea68723 to 4170844 Compare September 8, 2024 20:08
@JonRowe JonRowe force-pushed the switch-thread-local-data-to-local-attr branch from 4170844 to 1b8a0d2 Compare November 15, 2024 20:20
@JonRowe JonRowe force-pushed the switch-thread-local-data-to-local-attr branch from fe1d8a1 to d627b9e Compare November 15, 2024 21:17
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