diff options
Diffstat (limited to 'actioncable/test')
-rw-r--r-- | actioncable/test/client_test.rb | 10 | ||||
-rw-r--r-- | actioncable/test/subscription_adapter/common.rb | 8 |
2 files changed, 1 insertions, 17 deletions
diff --git a/actioncable/test/client_test.rb b/actioncable/test/client_test.rb index 4ade9832e0..f2b090cc52 100644 --- a/actioncable/test/client_test.rb +++ b/actioncable/test/client_test.rb @@ -16,12 +16,8 @@ class ClientTest < ActionCable::TestCase ::Object.const_set(:ApplicationCable, Module.new) ::ApplicationCable.const_set(:Connection, Class.new(ActionCable::Connection::Base)) - ::Object.const_set(:Rails, Module.new) - ::Rails.singleton_class.send(:define_method, :root) { Pathname.new(__dir__) } - ActionCable.instance_variable_set(:@server, nil) server = ActionCable.server - server.config = ActionCable::Server::Configuration.new inner_logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN } server.config.logger = ActionCable::Connection::TaggedLoggerProxy.new(inner_logger, tags: []) @@ -29,7 +25,7 @@ class ClientTest < ActionCable::TestCase # and now the "real" setup for our test: server.config.disable_request_forgery_protection = true - server.config.channel_load_paths = [File.expand_path('client', __dir__)] + server.config.channel_paths = [ File.expand_path('client/echo_channel.rb', __dir__) ] Thread.new { EventMachine.run } unless EventMachine.reactor_running? Thread.pass until EventMachine.reactor_running? @@ -45,10 +41,6 @@ class ClientTest < ActionCable::TestCase ::Object.send(:remove_const, :ApplicationCable) rescue NameError end - begin - ::Object.send(:remove_const, :Rails) - 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 361858784e..1b6f8c70bf 100644 --- a/actioncable/test/subscription_adapter/common.rb +++ b/actioncable/test/subscription_adapter/common.rb @@ -13,11 +13,7 @@ module CommonSubscriptionAdapterTest ::Object.const_set(:ApplicationCable, Module.new) ::ApplicationCable.const_set(:Connection, Class.new(ActionCable::Connection::Base)) - ::Object.const_set(:Rails, Module.new) - ::Rails.singleton_class.send(:define_method, :root) { Pathname.new(__dir__) } - server = ActionCable::Server::Base.new - server.config = ActionCable::Server::Configuration.new inner_logger = Logger.new(StringIO.new).tap { |l| l.level = Logger::UNKNOWN } server.config.logger = ActionCable::Connection::TaggedLoggerProxy.new(inner_logger, tags: []) @@ -39,10 +35,6 @@ module CommonSubscriptionAdapterTest ::Object.send(:remove_const, :ApplicationCable) rescue NameError end - begin - ::Object.send(:remove_const, :Rails) - rescue NameError - end end |