Sha256: 1aab59b56f7067e2177e9a1fa2976c75432c543e10f07b06e91cb3675eccad48

Contents?: true

Size: 925 Bytes

Versions: 30

Compression:

Stored size: 925 Bytes

Contents

require 'spec_helper'

describe 'Server description' do
  clean_slate

  let(:client) { ClientRegistry.instance.global_client('authorized') }
  let(:desc) do
    client.cluster.next_primary.description
  end

  let!(:start_time) { Time.now }

  describe '#op_time' do
    require_topology :replica_set
    min_server_fcv '3.4'

    it 'is set' do
      expect(desc).not_to be_unknown

      expect(desc.op_time).to be_a(BSON::Timestamp)
    end
  end

  describe '#last_write_date' do
    require_topology :replica_set
    min_server_fcv '3.4'

    it 'is set' do
      expect(desc).not_to be_unknown

      expect(desc.last_write_date).to be_a(Time)
    end
  end

  describe '#last_update_time' do

    it 'is set' do
      expect(desc).not_to be_unknown

      expect(desc.last_update_time).to be_a(Time)
      # checked while this test was running
      expect(desc.last_update_time).to be > start_time
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mongo-2.13.3 spec/integration/server_description_spec.rb
mongo-2.14.1 spec/integration/server_description_spec.rb
mongo-2.15.0.alpha spec/integration/server_description_spec.rb
mongo-2.13.2 spec/integration/server_description_spec.rb
mongo-2.14.0 spec/integration/server_description_spec.rb
mongo-2.14.0.rc1 spec/integration/server_description_spec.rb
mongo-2.13.1 spec/integration/server_description_spec.rb
mongo-2.12.4 spec/integration/server_description_spec.rb
mongo-2.11.6 spec/integration/server_description_spec.rb
mongo-2.13.0 spec/integration/server_description_spec.rb
mongo-2.12.3 spec/integration/server_description_spec.rb
mongo-2.13.0.rc1 spec/integration/server_description_spec.rb
mongo-2.12.2 spec/integration/server_description_spec.rb
mongo-2.10.5 spec/integration/server_description_spec.rb
mongo-2.11.5 spec/integration/server_description_spec.rb
mongo-2.13.0.beta1 spec/integration/server_description_spec.rb
mongo-2.12.1 spec/integration/server_description_spec.rb
mongo-2.12.0.rc0 spec/integration/server_description_spec.rb
mongo-2.11.4 spec/integration/server_description_spec.rb
mongo-2.10.4 spec/integration/server_description_spec.rb