diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-05 22:48:48 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-14 17:46:48 +0100 |
commit | 661298176c72eefc6d0f42b58210119e76962364 (patch) | |
tree | 521b31e85b607dff781a3ad40ae43bdf52022f8b /actioncable/test/subscription_adapter/common.rb | |
parent | f611e59cb16677156c231aa6328f7e7d47da2a28 (diff) | |
download | rails-661298176c72eefc6d0f42b58210119e76962364.tar.gz rails-661298176c72eefc6d0f42b58210119e76962364.tar.bz2 rails-661298176c72eefc6d0f42b58210119e76962364.zip |
Inject Rails' channel paths in engine.
We were explicitly referencing Rails.root in ActionCable::Server::Configuration.initialize,
thereby coupling ourselves to Rails.
Instead add `app/channels` to Rails' app paths and assign the existent files
to `channel_paths`.
Users can still append to those load paths with `<<` and `push` in `config/application.rb`.
This means we can remove the custom `Dir` lookup in `channel_paths` and the Rails
and root definitions in the tests.
Diffstat (limited to 'actioncable/test/subscription_adapter/common.rb')
-rw-r--r-- | actioncable/test/subscription_adapter/common.rb | 8 |
1 files changed, 0 insertions, 8 deletions
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 |