Sha256: 93f2bc4817903d6f4a25b99e77b594d9dfe1d7e7e19fdc28f776c5d9ab03fa80
Contents?: true
Size: 1.03 KB
Versions: 17
Compression:
Stored size: 1.03 KB
Contents
require "spec_helper" describe Shamu::Events::InMemory::AsyncService do let( :service ) { scorpion.new Shamu::Events::InMemory::AsyncService } let( :message ) { Shamu::Events::Message.new } describe "#publish" do it "adds message to channel" do expect do service.publish( "spec", message ) end.to change { service.channel_stats( "spec" )[ :queue_size ] } end it "serializes the message" do expect( service ).to receive( :serialize ).and_call_original service.publish( "spec", message ) end end describe "#subscribe" do it "receives a message" do expect do |b| service.subscribe "spec", &b service.publish "spec", message wait_for { service.channel_stats( "spec" )[ :queue_size ] }.to eq 0 end.to yield_control end it "deserializes the message" do expect( service ).to receive( :deserialize ).and_call_original service.publish "spec", message wait_for { service.channel_stats( "spec" )[ :queue_size ] }.to eq 0 end end end
Version data entries
17 entries across 17 versions & 1 rubygems