1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
# frozen_string_literal: true
# rubocop:todo all
require 'lite_spec_helper'
describe Mongo::Monitoring::Event::ServerHeartbeatSucceeded 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(:event) do
described_class.new(address, 1, started_event: nil)
end
describe '#summary' do
it 'renders correctly' do
expect(event.summary).to eq('#<ServerHeartbeatSucceeded address=127.0.0.1:27017>')
end
end
end
|