spec/support/shared/destination_examples.rb in message-driver-0.3.0 vs spec/support/shared/destination_examples.rb in message-driver-0.4.0

- old
+ new

@@ -1,18 +1,18 @@ -shared_examples "a destination" do +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"} } + 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 + 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) } @@ -20,23 +20,23 @@ end end end shared_examples "doesn't support #message_count" do - describe "#message_count" do - it "raises an error" 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 +shared_examples 'supports #message_count' do it "reports it's message_count" do expect { - destination.publish("msg1") - destination.publish("msg2") + destination.publish('msg1') + destination.publish('msg2') pause_if_needed }.to change{destination.message_count}.by(2) end end