Skip to content

Commit c608e00

Browse files
committed
Switch order of tests in client_spec for receonnect recovery
1 parent 15df58d commit c608e00

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

spec/mongo/client_spec.rb

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,26 @@
585585
end
586586
end
587587

588-
describe '#close' do
588+
describe '#database_names' do
589+
590+
it 'returns a list of database names' do
591+
expect(root_authorized_client.database_names).to include(
592+
'admin'
593+
)
594+
end
595+
end
596+
597+
describe '#list_databases' do
598+
599+
it 'returns a list of database info documents' do
600+
expect(
601+
root_authorized_client.list_databases.collect do |i|
602+
i['name']
603+
end).to include('admin')
604+
end
605+
end
606+
607+
describe '#close' do
589608

590609
let(:client) do
591610
described_class.new(['127.0.0.1:27017'])
@@ -612,25 +631,7 @@
612631

613632
it 'reconnects the cluster and returns true' do
614633
expect(client.reconnect).to be(true)
615-
end
616-
end
617-
618-
describe '#database_names' do
619-
620-
it 'returns a list of database names' do
621-
expect(root_authorized_client.database_names).to include(
622-
'admin'
623-
)
624-
end
625-
end
626-
627-
describe '#list_databases' do
628-
629-
it 'returns a list of database info documents' do
630-
expect(
631-
root_authorized_client.list_databases.collect do |i|
632-
i['name']
633-
end).to include('admin')
634+
sleep(2)
634635
end
635636
end
636637
end

0 commit comments

Comments
 (0)