From 861ece99bb6d7ebdb27fad7db5ccc05340aaf0e5 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Fri, 5 Feb 2016 22:56:52 +0100 Subject: Default connection class to ActionCable::Connection::Base. Instead of depending on ApplicationCable::Connection being defined at initialize we should inject it in the Railtie. Thus we can kill more setup in the tests too. --- actioncable/test/client_test.rb | 8 -------- actioncable/test/subscription_adapter/common.rb | 8 -------- 2 files changed, 16 deletions(-) (limited to 'actioncable/test') diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index f2b090cc52..d294fa7bc6 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -13,9 +13,6 @@ class ClientTest < ActionCable::TestCase def setup # TODO: ActionCable requires a *lot* of setup at the moment... - ::Object.const_set(:ApplicationCable, Module.new) - ::ApplicationCable.const_set(:Connection, Class.new(ActionCable::Connection::Base)) - ActionCable.instance_variable_set(:@server, nil) server = ActionCable.server inner_logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN } @@ -36,11 +33,6 @@ class ClientTest < ActionCable::TestCase def teardown $VERBOSE = @previous_verbose - - begin - ::Object.send(:remove_const, :ApplicationCable) - rescue NameError - end end def with_puma_server(rack_app = ActionCable.server, port = 3099) diff --git a/actioncable/test/subscription_adapter/common.rb b/actioncable/test/subscription_adapter/common.rb index 1b6f8c70bf..b06e3cb761 100644 --- a/actioncable/test/subscription_adapter/common.rb +++ b/actioncable/test/subscription_adapter/common.rb @@ -10,9 +10,6 @@ module CommonSubscriptionAdapterTest def setup # TODO: ActionCable requires a *lot* of setup at the moment... - ::Object.const_set(:ApplicationCable, Module.new) - ::ApplicationCable.const_set(:Connection, Class.new(ActionCable::Connection::Base)) - server = ActionCable::Server::Base.new inner_logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN } server.config.logger = ActionCable::Connection::TaggedLoggerProxy.new(inner_logger, tags: []) @@ -30,11 +27,6 @@ module CommonSubscriptionAdapterTest def teardown @tx_adapter.shutdown if @tx_adapter && @tx_adapter != @rx_adapter @rx_adapter.shutdown if @rx_adapter - - begin - ::Object.send(:remove_const, :ApplicationCable) - rescue NameError - end end -- cgit v1.2.3