From 3cd69fa2c025da1cc45b1b9b43b227cceb025837 Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Fri, 14 Dec 2018 16:46:39 -0500 Subject: Allow passing custom config to ActionCable::Server::Base That allows us to create a separate, isolated Action Cable server instance within the same app. --- actioncable/test/subscription_adapter/channel_prefix.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'actioncable/test') diff --git a/actioncable/test/subscription_adapter/channel_prefix.rb b/actioncable/test/subscription_adapter/channel_prefix.rb index 3071facd9d..475e6cfd3a 100644 --- a/actioncable/test/subscription_adapter/channel_prefix.rb +++ b/actioncable/test/subscription_adapter/channel_prefix.rb @@ -2,17 +2,9 @@ require "test_helper" -class ActionCable::Server::WithIndependentConfig < ActionCable::Server::Base - # ActionCable::Server::Base defines config as a class variable. - # Need config to be an instance variable here as we're testing 2 separate configs - def config - @config ||= ActionCable::Server::Configuration.new - end -end - module ChannelPrefixTest def test_channel_prefix - server2 = ActionCable::Server::WithIndependentConfig.new + server2 = ActionCable::Server::Base.new(config: ActionCable::Server::Configuration.new) server2.config.cable = alt_cable_config server2.config.logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN } -- cgit v1.2.3