Skip to content

Commit 83dd53d

Browse files
committed
[CLIENT] Group tests into their transport adapters
1 parent 001f012 commit 83dd53d

File tree

1 file changed

+37
-35
lines changed

1 file changed

+37
-35
lines changed

elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,59 +1241,61 @@
12411241

12421242
context 'when \'transport_options\' are defined with \'accept_encoding\' specified' do
12431243

1244-
context 'when using the Net::HTTP adapter' do
1244+
context 'when using Faraday as the transport' do
12451245

1246-
let!(:client) do
1247-
#described_class.new(transport_options: { headers: { accept_encoding: 'gzip' } }, adapter: :net_http)
1248-
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http)
1249-
end
1246+
context 'when using the Net::HTTP adapter' do
1247+
1248+
let(:client) do
1249+
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http)
1250+
end
12501251

1251-
it 'sets the options on the transport' do
1252-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1252+
it 'sets the options on the transport' do
1253+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1254+
end
12531255
end
1254-
end
12551256

1256-
context 'when using the HTTPClient adapter' do
1257+
context 'when using the HTTPClient adapter' do
12571258

1258-
let!(:client) do
1259-
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :httpclient)
1260-
end
1259+
let(:client) do
1260+
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :httpclient)
1261+
end
12611262

1262-
it 'sets the options on the transport' do
1263-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1263+
it 'sets the options on the transport' do
1264+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1265+
end
12641266
end
1265-
end
12661267

1267-
context 'when using the Patron adapter' do
1268+
context 'when using the Patron adapter' do
12681269

1269-
let!(:client) do
1270-
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :patron)
1271-
end
1270+
let(:client) do
1271+
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :patron)
1272+
end
12721273

1273-
it 'sets the options on the transport' do
1274-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1274+
it 'sets the options on the transport' do
1275+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1276+
end
12751277
end
1276-
end
12771278

1278-
context 'when using the Net::HTTP::Persistent adapter' do
1279+
context 'when using the Net::HTTP::Persistent adapter' do
12791280

1280-
let!(:client) do
1281-
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http_persistent)
1282-
end
1281+
let(:client) do
1282+
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http_persistent)
1283+
end
12831284

1284-
it 'sets the options on the transport' do
1285-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1285+
it 'sets the options on the transport' do
1286+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1287+
end
12861288
end
1287-
end
12881289

1289-
context 'when using the Typhoeus adapter' do
1290+
context 'when using the Typhoeus adapter' do
12901291

1291-
let!(:client) do
1292-
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :typhoeus)
1293-
end
1292+
let(:client) do
1293+
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :typhoeus)
1294+
end
12941295

1295-
it 'sets the options on the transport' do
1296-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1296+
it 'sets the options on the transport' do
1297+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1298+
end
12971299
end
12981300
end
12991301
end

0 commit comments

Comments
 (0)