Method: ActionCable::Channel::ConnectionStub#initialize

Defined in:
lib/action_cable/channel/test_case.rb

#initialize(identifiers = {}) ⇒ ConnectionStub

Returns a new instance of ConnectionStub.



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/action_cable/channel/test_case.rb', line 55

def initialize(identifiers = {})
  @server = ActionCable.server
  @transmissions = []

  identifiers.each do |identifier, val|
    define_singleton_method(identifier) { val }
  end

  @subscriptions = ActionCable::Connection::Subscriptions.new(self)
  @identifiers = identifiers.keys
  @logger = ActiveSupport::TaggedLogging.new ActiveSupport::Logger.new(StringIO.new)
end