Sha256: 72b4fa3814c56606dfde912ea279fd1142ee08c543634ea4babcd712d7e5ca54

Contents?: true

Size: 965 Bytes

Versions: 18

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'lite_spec_helper'

describe Mongo::Monitoring::Event::ServerDescriptionChanged do

  let(:address) do
    Mongo::Address.new('127.0.0.1:27017')
  end

  let(:monitoring) { double('monitoring') }

  let(:cluster) do
    double('cluster').tap do |cluster|
      allow(cluster).to receive(:addresses).and_return([address])
      allow(cluster).to receive(:servers_list).and_return([])
    end
  end

  let(:topology) do
    Mongo::Cluster::Topology::Unknown.new({}, monitoring, cluster)
  end

  let(:previous_desc) { Mongo::Server::Description.new(address) }
  let(:updated_desc) { Mongo::Server::Description.new(address) }

  let(:event) do
    described_class.new(address, topology, previous_desc, updated_desc)
  end

  describe '#summary' do

    it 'renders correctly' do
      expect(event.summary).to eq("#<ServerDescriptionChanged address=127.0.0.1:27017 prev=UNKNOWN new=UNKNOWN>")
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mongo-2.16.4 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.17.4 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.18.3 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.18.2 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.17.3 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.18.1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.18.0 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.17.2 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.16.3 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.18.0.beta1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.16.2 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.17.1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.16.1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.17.0 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.16.0 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.15.1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.16.0.alpha1 spec/mongo/monitoring/event/server_description_changed_spec.rb
mongo-2.15.0 spec/mongo/monitoring/event/server_description_changed_spec.rb