Sha256: 8db1cacb0a61af4bf6d33f5ea0a0564eb020654379b8eaf0d9d8e529675686dc

Contents?: true

Size: 759 Bytes

Versions: 1

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

require "test_helper"
require "stubs/test_server"
require "active_support/core_ext/hash/indifferent_access"

class BaseTest < ActiveSupport::TestCase
  def setup
    @server = ActionCable::Server::Base.new
    @server.config.cable = { adapter: "async" }.with_indifferent_access
  end

  class FakeConnection
    def close
    end
  end

  test "#restart closes all open connections" do
    conn = FakeConnection.new
    @server.add_connection(conn)

    conn.expects(:close)
    @server.restart
  end

  test "#restart shuts down worker pool" do
    @server.worker_pool.expects(:halt)
    @server.restart
  end

  test "#restart shuts down pub/sub adapter" do
    @server.pubsub.expects(:shutdown)
    @server.restart
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-on-quails-0.1.0 actioncable/test/server/base_test.rb