Sha256: 6dd97d95bfffb780ee74032bd36cc9b90c164175c356cef3fb562bf8f23697d0

Contents?: true

Size: 747 Bytes

Versions: 5

Compression:

Stored size: 747 Bytes

Contents

RSpec.shared_examples 'an adapter' do
  describe '#new_context' do
    it 'returns a MessageDriver::Adapters::ContextBase' do
      expect(subject.new_context).to be_a MessageDriver::Adapters::ContextBase
    end
  end

  describe '#stop' do
    it 'invalidates all the adapter contexts' do
      ctx1 = subject.new_context
      ctx2 = subject.new_context
      subject.stop
      expect(ctx1).to_not be_valid
      expect(ctx2).to_not be_valid
    end
  end

  describe '#broker' do
    it 'returns the broker associated with the adapter' do
      expect(subject.broker).to be(broker)
    end
  end

  it { expect(subject.class).to respond_to(:new).with(1..2).arguments }
  it { is_expected.to respond_to(:build_context).with(0).arguments }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
message-driver-1.0.1 spec/support/shared/adapter_examples.rb
message-driver-1.0.0 spec/support/shared/adapter_examples.rb
message-driver-0.7.2 spec/support/shared/adapter_examples.rb
message-driver-0.7.1 spec/support/shared/adapter_examples.rb
message-driver-0.7.0 spec/support/shared/adapter_examples.rb