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