Sha256: cd0ae5049f819501f264fe8f6a00f28469f1717cc8007e9a84515099e5a792cf

Contents?: true

Size: 975 Bytes

Versions: 7

Compression:

Stored size: 975 Bytes

Contents

require 'helper'

describe EM::WebSocket::MessageProcessor06 do
  class MessageProcessorContainer06
    attr_accessor :connection
    include EM::WebSocket::MessageProcessor06
    def debug(*args); end    
  end
  
  before :each do
    @mp = MessageProcessorContainer06.new
    @mp.connection = Object.new
  end
  
  describe "#message" do
    it "accepts a close"
    it "accepts a ping"
    
    it "accepts a pong" do
      @mp.connection.should_receive(:trigger_on_message).with(:rock, :pong)
      @mp.message :pong, :fraggle, :rock
    end

    it "accepts a binary message" do
      @mp.connection.should_receive(:trigger_on_message).with(:rock, :binary)
      @mp.message :binary, :fraggle, :rock
    end
    
    it "accepts a non-UTF8 text message"
    
    it "accepts a text message" do
      @mp.connection.should_receive(:trigger_on_message).with(:rock, :text)
      @mp.message :text, :fraggle, :rock
    end    
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sonixlabs-em-websocket-0.5.1.5 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.5.1.4 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.5.1.3 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.5.1.2 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.5.1.1 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.3.8 spec/unit/message_processor_spec.rb
sonixlabs-em-websocket-0.3.7 spec/unit/message_processor_spec.rb