Sha256: e762af7bbdd119502caa775db871c8ae4dc17c6d5fe6b90b5f3bed84e18988c9

Contents?: true

Size: 747 Bytes

Versions: 11

Compression:

Stored size: 747 Bytes

Contents

require 'spec_helper'
require 'support/mock_web_socket'

module WebsocketRails
  module ConnectionAdapters
    describe WebSocket do

      before do
        @socket = MockWebSocket.new
        Faye::WebSocket.stub(:new).and_return(@socket)
        @adapter = WebSocket.new( mock_request, double('Dispatcher').as_null_object )
      end

      describe "#send" do
        it "should send the message to the websocket connection" do
          @socket.should_receive(:send).with(:message)
          @adapter.send :message
        end
      end

      describe "#close!" do
        it "calls #close on the underlying WebSocket connection" do
          @socket.should_receive(:close)
          @adapter.close!
        end
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
hkroger-websocket-rails-0.7.1 spec/unit/connection_adapters/web_socket_spec.rb
wwl-websocket-rails-0.7.3 spec/unit/connection_adapters/web_socket_spec.rb
wwl-websocket-rails-0.7.2 spec/unit/connection_adapters/web_socket_spec.rb
wwl-websocket-rails-0.7.1 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.7.0 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.6.2 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.6.1 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.6.0 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.5.0 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.4.9 spec/unit/connection_adapters/web_socket_spec.rb
websocket-rails-0.4.8 spec/unit/connection_adapters/web_socket_spec.rb