Sha256: 1503bcc379c9209f2acff534df4a674e72a3b6f98f853257da820f1546f1a0bc
Contents?: true
Size: 774 Bytes
Versions: 33
Compression:
Stored size: 774 Bytes
Contents
require 'spec_helper' describe 'Server Selection moving average round trip time calculation' do include Mongo::ServerSelection::RTT SERVER_SELECTION_RTT_TESTS.each do |file| spec = Mongo::ServerSelection::RTT::Spec.new(file) context(spec.description) do let(:averager) do Mongo::Server::RoundTripTimeAverager.new end before do averager.instance_variable_set(:@average_round_trip_time, spec.average_rtt) averager.instance_variable_set(:@last_round_trip_time, spec.new_rtt) averager.send(:update_average_round_trip_time) end it 'correctly calculates the moving average round trip time' do expect(averager.average_round_trip_time).to eq(spec.new_average_rtt) end end end end
Version data entries
33 entries across 33 versions & 2 rubygems