Skip to content

Commit 6c734f5

Browse files
committed
[CLIENT] Add another test for hostname/ipv6:port format
1 parent 39e424a commit 6c734f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

elasticsearch-transport/spec/elasticsearch/transport/sniffer_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,25 @@
229229
it 'correctly parses the port' do
230230
expect(hosts[0][:port]).to eq('9250')
231231
end
232+
233+
context 'when the address is IPv6' do
234+
235+
let(:publish_address) do
236+
'example.com/[::1]:9250'
237+
end
238+
239+
it 'parses the response' do
240+
expect(hosts.size).to eq(1)
241+
end
242+
243+
it 'uses the hostname' do
244+
expect(hosts[0][:host]).to eq('example.com')
245+
end
246+
247+
it 'correctly parses the port' do
248+
expect(hosts[0][:port]).to eq('9250')
249+
end
250+
end
232251
end
233252

234253
context 'when the address is IPv6' do

0 commit comments

Comments
 (0)