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

chore: Rubocop lint Style/MissingRespondToMissing #930

Conversation

Insti
Copy link
Contributor

@Insti Insti commented Mar 4, 2019

Description

Fix for Rubocop lint Style/MissingRespondToMissing
This is part of the RuboCop Quest: #854

Instead of adding a new respond_to? method, add respond_to_missing? which still provides the required respond_to? behaviour.

Additional Notes

Includes the changes from #929 that fix a test ordering dependency issue.

The assignment to the mock connection:

`Faraday.default_connection = mock_connection`

was persisting throughout the tests.

If the random number generator is unlucky the following error occurs:

\#<Double "Connection"> was originally created in one example but has leaked into another example and can no longer be used.  rspec-mocks' doubles are designed to only last for one example, and you need to create a new one in each example you wish to use it for.

This commit fixes the issue by explicitly setting the default_connection
back to nil in an "after" block after the tests have run.

Subsequent calls to `default_connection` within the test suite then
behave as previously expected irrespective of the random test ordering.
@olleolleolle
Copy link
Member

@Insti Would this be possible to rebase on top of master, now?

@Insti
Copy link
Contributor Author

Insti commented Mar 4, 2019

Sure, is it ok if I force push?

@olleolleolle olleolleolle mentioned this pull request Mar 4, 2019
@olleolleolle
Copy link
Member

@Insti Oh, you don't have to, now. I'll Squash this on merge.

@olleolleolle olleolleolle merged commit e342992 into lostisland:master Mar 4, 2019
@Insti Insti deleted the rubocop_lint_Style/MissingRespondToMissing branch March 4, 2019 22:25
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.

None yet

2 participants