Conversation
Envek
left a comment
There was a problem hiding this comment.
Let's try rubocop --autocorrect maybe? 😄
Co-authored-by: Andrey Novikov <envek@envek.name>
I'm fine with that, but then we probably need to bump anycable version in gemspec to one that started to require Ruby 2.7. In general it is better to support older Rubies as long as possible, maybe with help from ruby-next (there are a lot applications on old unmaintained Rubies in the wild)
👍 |
@Envek, AnyCable supports ruby >= 2.7. I think in this case supporting the same ruby version is enough. Link to AnyCable Requirements |
|
|
||
| RSpec.describe GraphQL::AnyCable do | ||
| subject do | ||
| subject(:execute_query) do |
There was a problem hiding this comment.
@Envek, I gave subjects names based on the spec NamedSubject. What do you think about this? I am especially worried about the possibility that I gave not-good-enough names for these variables.
| socket = double("Socket", istate: AnyCable::Socket::State.new({})) | ||
| connection = double("Connection", anycable_socket: socket) | ||
| double("Channel", id: "legacy_id", params: { "channelId" => "legacy_id" }, stream_from: nil, connection: connection) | ||
| socket = instance_double(AnyCable::Socket, istate: AnyCable::Socket::State.new({})) |
There was a problem hiding this comment.
@Envek, I have changed double to instance_double and have passed classes instead of strings. Do you think this will improve the readability? The tests pass successfully, but I am unsure if using these classes and modules is 100% correct.
Because of these changes, I had to add the method id to the class FakeConnection::Channel. Is that okay?
|
|
||
| let(:object) do | ||
| double("Post", id: 1, title: "Broadcasting…", actions: %w[Edit Delete]) | ||
| double(Post, id: 1, title: "Broadcasting…", actions: %w[Edit Delete]) # rubocop:disable RSpec/VerifiedDoubles |
There was a problem hiding this comment.
@Envek, I could not use instance_double here because instances of GraphQL::Schema::Object don't have methods.
| require "integration_helper" | ||
|
|
||
| RSpec.describe "broadcastable subscriptions" do | ||
| subject(:execute_request) { handler.handle(:command, request) } |
There was a problem hiding this comment.
@Envek, I cannot understand where the variable request comes from. Can you show me that?
Important updates:
anycablegem supports ruby >= 2.7 (which is also non-secure already)gemspecto GemfileFuture plans: