Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Specs for Ruby firehose client

  • Loading branch information...
commit a14cba193bb196cc388f51f9a349496b6c2f0406 1 parent 02951cc
Brad Gessler authored
Showing with 27 additions and 0 deletions.
  1. +27 −0 spec/integrations/firehose_client_spec.rb
View
27 spec/integrations/firehose_client_spec.rb
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe Firehose::Client do
+ let(:channel) { "/something/somewhere" }
+ let(:client) { Firehose::Client.new }
+
+ it "should pub/sub" do
+ sent, received = "Hey dude", []
+
+ EM.run {
+ EM.add_timer(5) { EM.stop }
+
+ client.subscribe_to(channel) do |msg| do
+ received << msg
+ end
+
+ client.subscribe_to(channel) do |msg| do
+ received << msg
+ end
+
+ client.publish(sent).to(channel)
+ }
+
+ sent.should == received.first
+ sent.should == received.last
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.