Sha256: 321629c2a405de01b384faf55d280bdf696a071dd65bfc487e48d8fe232d23ce

Contents?: true

Size: 702 Bytes

Versions: 28

Compression:

Stored size: 702 Bytes

Contents

require 'spec_helper'

module WebsocketRails
  describe EventQueue do

    describe "#initialize" do
      it "should create an empty queue" do
        subject.queue.should == []
      end
    end

    describe "#<<" do
      it "should add the item to the queue" do
        subject << 'event'
        subject.queue.should == ['event']
      end
    end

    describe "#flush" do
      before do
        subject.queue << 'event'
      end

      it "should yield all items in the queue" do
        subject.flush do |event|
          event.should == 'event'
        end
      end

      it "should empty the queue" do
        subject.flush
        subject.queue.should == []
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
hkroger-websocket-rails-0.7.1 spec/unit/event_queue_spec.rb
wwl-websocket-rails-0.7.3 spec/unit/event_queue_spec.rb
wwl-websocket-rails-0.7.2 spec/unit/event_queue_spec.rb
wwl-websocket-rails-0.7.1 spec/unit/event_queue_spec.rb
websocket-rails-0.7.0 spec/unit/event_queue_spec.rb
websocket-rails-0.6.2 spec/unit/event_queue_spec.rb
websocket-rails-0.6.1 spec/unit/event_queue_spec.rb
websocket-rails-0.6.0 spec/unit/event_queue_spec.rb
websocket-rails-0.5.0 spec/unit/event_queue_spec.rb
websocket-rails-0.4.9 spec/unit/event_queue_spec.rb
websocket-rails-0.4.8 spec/unit/event_queue_spec.rb
websocket-rails-0.4.7 spec/unit/event_queue_spec.rb
websocket-rails-0.4.6 spec/unit/event_queue_spec.rb
websocket-rails-0.4.5 spec/unit/event_queue_spec.rb
websocket-rails-0.4.4 spec/unit/event_queue_spec.rb
websocket-rails-0.4.3 spec/unit/event_queue_spec.rb
websocket-rails-0.4.2 spec/unit/event_queue_spec.rb
websocket-rails-0.4.1 spec/unit/event_queue_spec.rb
websocket-rails-0.4.0 spec/unit/event_queue_spec.rb
websocket-rails-0.3.0 spec/unit/event_queue_spec.rb