Sha256: 18deea74c6c81dfa57a1beafa70fa7db19f249ab8a133191a626f4a84e563ace

Contents?: true

Size: 764 Bytes

Versions: 6

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'

module MessageDriver::Subscription
  describe Base do
    let(:adapter) { double(MessageDriver::Adapters::Base) }
    let(:destination) { double(MessageDriver::Destination::Base) }
    let(:consumer) { double("a consumer") }
    subject(:subscription) { Base.new(adapter, destination, consumer) }

    it "sets it's adapter, destination and consumer on instansiation" do
      expect(subscription.adapter).to eq(adapter)
      expect(subscription.destination).to eq(destination)
      expect(subscription.consumer).to eq(consumer)
    end

    describe "#unsubscribe" do
      it "raises an error" do
        expect {
          subscription.unsubscribe
        }.to raise_error("must be implemented in subclass")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
message-driver-0.3.0 spec/units/message_driver/subscription_spec.rb
message-driver-0.2.2 spec/units/message_driver/subscription_spec.rb
message-driver-0.2.1 spec/units/message_driver/subscription_spec.rb
message-driver-0.2.0 spec/units/message_driver/subscription_spec.rb
message-driver-0.2.0.rc2 spec/units/message_driver/subscription_spec.rb
message-driver-0.2.0.rc1 spec/units/message_driver/subscription_spec.rb