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

fix: copy over rspec context to reactor thread #22

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

Goos
Copy link
Contributor

@Goos Goos commented May 25, 2023

We were running into some issues using async-rspec in specs that were trying to access spec metadata.

In our case, we're using a rspec-snapshot to let us match against snapshots, which uses the spec metadata to construct a directory path to load snapshots from. When we initialize said matcher in a spec example running inside the reactor, that metadata is nil, since it's stored as a thread-local variable.

The workaround here is just copying over the RSpec thread-local variables into the reactor block.

Types of Changes

  • Bug fix.

Contribution

@ioquatix
Copy link
Member

ioquatix commented Jun 5, 2023

This seems reasonable to me.

@ioquatix ioquatix merged commit 048847a into socketry:main Jun 5, 2023
@ioquatix ioquatix added this to the v1.17.0 milestone Jun 5, 2023
@Goos Goos deleted the goos/copy-rspec-context branch June 7, 2023 17: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.

3 participants