Sha256: d45bf4ce9e00848d4e80d0fed737ed49a0bf7151b20d33331ab3a152d766adb0

Contents?: true

Size: 1.43 KB

Versions: 14

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'

describe DispatchRider::Publisher::Configuration::NotificationService do

  let(:options) do
    {
      "default_folder" => "/tmp/dispatch_rider"
    }
  end

  subject { described_class.new("file_system", options) }

  describe "#name" do
    describe '#name' do
      subject { super().name }
      it { is_expected.to eq("file_system") }
    end
  end

  describe "#options" do
    describe '#options' do
      subject { super().options }
      it { is_expected.to eq(options) }
    end
  end

  describe "#==" do
    let(:other) { described_class.new(name, other_options) }

    context "two notification services with the same name and options" do
      let(:name) { subject.name }
      let(:other_options) { options }

      it { is_expected.to eq other }
    end

    context "two notification services with different names but the same options" do
      let(:name) { "aws_sns" }
      let(:other_options) { options }

      it { is_expected.not_to eq other }
    end

    context "two notificaiton services with the same name but different options" do
      let(:name) { subject.name }
      let(:other_options) { { "topic" => "employee_updates" } }

      it { is_expected.not_to eq other }
    end

    context "two notification services with different names and options" do
      let(:name) { "aws_sns" }
      let(:other_options) { { "topic" => "employee_updates" } }

      it { is_expected.not_to eq other }
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dispatch-rider-1.9.0 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.6 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.5 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.4 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.3 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.2 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.1 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.8.0 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.7.2 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.7.1 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.7.0 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.6.2 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.6.1 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb
dispatch-rider-1.6.0 spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb