aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/test/stubs
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/test/stubs')
-rw-r--r--actioncable/test/stubs/global_id.rb2
-rw-r--r--actioncable/test/stubs/room.rb4
-rw-r--r--actioncable/test/stubs/test_adapter.rb2
-rw-r--r--actioncable/test/stubs/test_connection.rb4
-rw-r--r--actioncable/test/stubs/test_server.rb22
-rw-r--r--actioncable/test/stubs/user.rb2
6 files changed, 20 insertions, 16 deletions
diff --git a/actioncable/test/stubs/global_id.rb b/actioncable/test/stubs/global_id.rb
index 334f0d03e8..15fab6b8a7 100644
--- a/actioncable/test/stubs/global_id.rb
+++ b/actioncable/test/stubs/global_id.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class GlobalID
attr_reader :uri
delegate :to_param, :to_s, to: :uri
diff --git a/actioncable/test/stubs/room.rb b/actioncable/test/stubs/room.rb
index cd66a0b687..df7236f408 100644
--- a/actioncable/test/stubs/room.rb
+++ b/actioncable/test/stubs/room.rb
@@ -1,7 +1,9 @@
+# frozen_string_literal: true
+
class Room
attr_reader :id, :name
- def initialize(id, name='Campfire')
+ def initialize(id, name = "Campfire")
@id = id
@name = name
end
diff --git a/actioncable/test/stubs/test_adapter.rb b/actioncable/test/stubs/test_adapter.rb
index bbd142b287..c481046973 100644
--- a/actioncable/test/stubs/test_adapter.rb
+++ b/actioncable/test/stubs/test_adapter.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class SuccessAdapter < ActionCable::SubscriptionAdapter::Base
def broadcast(channel, payload)
end
diff --git a/actioncable/test/stubs/test_connection.rb b/actioncable/test/stubs/test_connection.rb
index 885450dda6..fdddd1159e 100644
--- a/actioncable/test/stubs/test_connection.rb
+++ b/actioncable/test/stubs/test_connection.rb
@@ -1,4 +1,6 @@
-require 'stubs/user'
+# frozen_string_literal: true
+
+require "stubs/user"
class TestConnection
attr_reader :identifiers, :logger, :current_user, :server, :transmissions
diff --git a/actioncable/test/stubs/test_server.rb b/actioncable/test/stubs/test_server.rb
index b86f422a13..0bc4625e28 100644
--- a/actioncable/test/stubs/test_server.rb
+++ b/actioncable/test/stubs/test_server.rb
@@ -1,4 +1,6 @@
-require 'ostruct'
+# frozen_string_literal: true
+
+require "ostruct"
class TestServer
include ActionCable::Server::Connections
@@ -10,14 +12,8 @@ class TestServer
@logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
@config = OpenStruct.new(log_tags: [], subscription_adapter: subscription_adapter)
- @config.use_faye = ENV['FAYE'].present?
- @config.client_socket_class = if @config.use_faye
- ActionCable::Connection::FayeClientSocket
- else
- ActionCable::Connection::ClientSocket
- end
-
- @mutex = Monitor.new
+
+ @mutex = Monitor.new
end
def pubsub
@@ -25,11 +21,9 @@ class TestServer
end
def event_loop
- @event_loop ||= if @config.use_faye
- ActionCable::Connection::FayeEventLoop.new
- else
- ActionCable::Connection::StreamEventLoop.new
- end
+ @event_loop ||= ActionCable::Connection::StreamEventLoop.new.tap do |loop|
+ loop.instance_variable_set(:@executor, Concurrent.global_io_executor)
+ end
end
def worker_pool
diff --git a/actioncable/test/stubs/user.rb b/actioncable/test/stubs/user.rb
index a66b4f87d5..7894d1d9ae 100644
--- a/actioncable/test/stubs/user.rb
+++ b/actioncable/test/stubs/user.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class User
attr_reader :name