Sha256: 3f3b4b58d4ff8c58daaddc267ddb7331995a6c16dac2de7dee897a4a1ad6c92d

Contents?: true

Size: 675 Bytes

Versions: 9

Compression:

Stored size: 675 Bytes

Contents

require 'spec_helper'

module WebsocketRails

  describe ".channel_manager" do
    it "should load a new channel manager when first called" do
      WebsocketRails.channel_manager.should be_a ChannelManager
    end
  end

  describe ".[]" do
    it "should delegate to channel manager" do
      ChannelManager.any_instance.should_receive(:[]).with(:awesome_channel)
      WebsocketRails[:awesome_channel]
    end
  end

  describe ChannelManager do

    describe "#[]" do
      context "accessing a channel" do
        it "should create the channel if it does not exist" do
          subject[:awesome_channel].class.should == Channel
        end
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
websocket-rails-0.3.0 spec/unit/channel_manager_spec.rb
websocket-rails-0.2.1 spec/unit/channel_manager_spec.rb
websocket-rails-0.2.0 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.9 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.8 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.7 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.6 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.5 spec/unit/channel_manager_spec.rb
websocket-rails-0.1.4 spec/unit/channel_manager_spec.rb