Sha256: 5b16df3f7ed9a2195bb67a81fbf12b15acbb34e400459b3883ad6f657de40066

Contents?: true

Size: 452 Bytes

Versions: 11

Compression:

Stored size: 452 Bytes

Contents

require 'bait/pubsub'

describe Bait do
  describe ".broadcast" do
    let (:stream) { double(:stream) }
    let (:format) { "data: [\"foo\",\"bar\",\"baz\"]\n\n" }
    context 'one subscriber' do
      before { Bait.add_subscriber stream }
      it "broadcasts data to the subscriber" do
        stream.should_receive(:<<).with(format)
        Bait.broadcast :foo, :bar, :baz
      end
      after { Bait.remove_subscriber stream }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bait-0.5.13 spec/lib/bait/pubsub_spec.rb
bait-0.5.12 spec/lib/bait/pubsub_spec.rb
bait-0.5.11 spec/lib/bait/pubsub_spec.rb
bait-0.5.10 spec/lib/bait/pubsub_spec.rb
bait-0.5.9 spec/lib/bait/pubsub_spec.rb
bait-0.5.6 spec/lib/bait/pubsub_spec.rb
bait-0.5.5 spec/lib/bait/pubsub_spec.rb
bait-0.5.4 spec/lib/bait/pubsub_spec.rb
bait-0.5.2 spec/lib/bait/pubsub_spec.rb
bait-0.5.1 spec/lib/bait/pubsub_spec.rb
bait-0.5.0 spec/lib/bait/pubsub_spec.rb