spec/integration/client_spec.rb in mongo-2.15.0.alpha vs spec/integration/client_spec.rb in mongo-2.15.0
- old
+ new
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+# encoding: utf-8
+
require 'spec_helper'
describe 'Client' do
context 'after client is disconnected' do
let(:client) { authorized_client.with(server_selection_timeout: 1) }
@@ -7,11 +10,11 @@
before do
client.close
end
it 'is still usable for operations' do
- resp = client.database.command(ismaster: 1)
+ resp = client.database.command(ping: 1)
expect(resp).to be_a(Mongo::Operation::Result)
end
it 'is still usable for operations that can use sessions' do
client['collection'].insert_one(test: 1)
@@ -25,10 +28,10 @@
end
context 'operation that never uses sessions' do
it 'fails server selection' do
expect do
- client.database.command(ismaster: 1)
+ client.database.command(ping: 1)
end.to raise_error(Mongo::Error::NoServerAvailable)
end
end
context 'operation that can use sessions' do