Fix rubocop issue for action cable -- ostruct#47409
Merged
rafaelfranca merged 1 commit intorails:mainfrom Mar 3, 2023
Merged
Conversation
3e35a8a to
0e4e498
Compare
Member
|
@hahmed Can you look at fixing the rubocop failures? |
bd397ee to
b3546f0
Compare
zzak
reviewed
Feb 21, 2023
zzak
reviewed
Feb 21, 2023
1a026e3 to
f696dd7
Compare
4 tasks
Contributor
I don't like the idea of exposing library internals just for the sake of fixing an accidentally introduce regression. SuccessAdapter doesn't make any sense for applications as well as TestServer. Channel::TestCase is meant for isolated testing, no server should be involved at all. Here is an alternative fix: #47483 |
subscription_adapter, so we no longer have to use openstruct.
f696dd7 to
627322e
Compare
zzak
reviewed
Mar 3, 2023
| @@ -1,18 +1,28 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| require "ostruct" | |||
Member
There was a problem hiding this comment.
Unrelated, but I do like removing ostruct 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Action cable is breaking when creating a simple test like below, because of an errorNameError: uninitialized constant ActionCable::Channel::ConnectionStub::TestServer. The test_server is now inside the lib folder, alongside a the success_adapter which it depends on.This Pull Request has been created because #47377 which relates to a change merged in #47300The second commit addresses the rubocop performance issue where I added a fake config class that inherits from
ActionCable::Server::Configuration. Thesubscription_adapteris added so it can be overridden in tests, this seems like a a better option than using a struct in which a whole bunch of vars need to be assigned/overridden.Detail
Fix rubocop issue with using ostruct.
Additional information
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]