spec/integration/bunny/bunny_adapter_spec.rb in message-driver-0.5.3 vs spec/integration/bunny/bunny_adapter_spec.rb in message-driver-0.6.0

- old
+ new

@@ -13,11 +13,11 @@ shared_examples 'raises an error' do it 'raises an error' do stub_const('Bunny::VERSION', version) expect do described_class.new(broker, valid_connection_attrs) - end.to raise_error MessageDriver::Error, 'bunny 1.2.2 or later is required for the bunny adapter' + end.to raise_error MessageDriver::Error, 'bunny 1.7.0 or later is required for the bunny adapter' end end shared_examples "doesn't raise an error" do it "doesn't raise an an error" do stub_const('Bunny::VERSION', version) @@ -25,17 +25,17 @@ expect do adapter = described_class.new(broker, valid_connection_attrs) end.to_not raise_error end end - %w(0.8.0 0.9.0 0.9.8 0.10.7 1.0.3 1.1.2 1.2.1).each do |v| + %w(0.8.0 0.9.0 0.9.8 0.10.7 1.0.3 1.1.2 1.2.1 1.2.2 1.3.0 1.4.1 1.6.2).each do |v| context "bunny version #{v}" do let(:version) { v } include_examples 'raises an error' end end - %w(1.2.2 1.3.2 1.4.0 1.5.0).each do |v| + %w(1.7.0 1.7.1 2.0.1 2.1.0).each do |v| context "bunny version #{v}" do let(:version) { v } include_examples "doesn't raise an error" end end @@ -80,24 +80,11 @@ end describe '#ack_key' do include_context 'a connected bunny adapter' - context 'when bunny version is 1.5.0 or later' do - before do - stub_const('Bunny::VERSION', '1.5.0') - end - it 'should be :manual_ack' do - expect(adapter.ack_key).to eq(:manual_ack) - end - end - context 'when bunny version earlier than 1.5.0' do - before do - stub_const('Bunny::VERSION', '1.4.1') - end - it 'should be :manual_ack' do - expect(adapter.ack_key).to eq(:ack) - end + it 'should be :manual_ack' do + expect(adapter.ack_key).to eq(:manual_ack) end end describe '#new_context' do include_context 'a connected bunny adapter'