Sha256: 3beec0996b1487a625dfcede03fe283beebcc6fab8e2606633f9830ee64350cd
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
shared_examples 'a destination' do its(:adapter) { should be adapter } describe '#pop_message' do let(:body) { 'The message body' } let(:headers) { { 'foo' => 'bar', 'bar' => 'baz'} } let(:properties) { {persistent: true, client_ack: true} } before do destination.publish(body, headers, properties) end context 'the result' do subject(:message) { destination.pop_message } it { should be_a MessageDriver::Message::Base } its(:body) { should eq(body) } its(:headers) { should include(headers) } its(:properties) { should_not be_nil } end end end shared_examples "doesn't support #message_count" do describe '#message_count' do it 'raises an error' do expect { destination.message_count }.to raise_error "#message_count is not supported by #{destination.class}" end end end shared_examples 'supports #message_count' do it "reports it's message_count" do expect { destination.publish('msg1') destination.publish('msg2') pause_if_needed }.to change{destination.message_count}.by(2) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
message-driver-0.4.0 | spec/support/shared/destination_examples.rb |