spec/faraday/connection_spec.rb in faraday-2.5.1 vs spec/faraday/connection_spec.rb in faraday-2.5.2
- old
+ new
@@ -4,11 +4,11 @@
def encode(params)
params.map { |k, v| "#{k.upcase}-#{v.to_s.upcase}" }.join(',')
end
def decode(params)
- params.split(',').map { |pair| pair.split('-') }.to_h
+ params.split(',').to_h { |pair| pair.split('-') }
end
end
shared_examples 'initializer with url' do
context 'with simple url' do
@@ -509,45 +509,45 @@
end
it 'uses env http_proxy' do
with_env 'http_proxy' => 'http://proxy.com' do
conn = Faraday.new
- expect(conn.instance_variable_get('@manual_proxy')).to be_falsey
+ expect(conn.instance_variable_get(:@manual_proxy)).to be_falsey
expect(conn.proxy_for_request('http://google.co.uk').host).to eq('proxy.com')
end
end
it 'uses processes no_proxy before http_proxy' do
with_env 'http_proxy' => 'http://proxy.com', 'no_proxy' => 'google.co.uk' do
conn = Faraday.new
- expect(conn.instance_variable_get('@manual_proxy')).to be_falsey
+ expect(conn.instance_variable_get(:@manual_proxy)).to be_falsey
expect(conn.proxy_for_request('http://google.co.uk')).to be_nil
end
end
it 'uses env https_proxy' do
with_env 'https_proxy' => 'https://proxy.com' do
conn = Faraday.new
- expect(conn.instance_variable_get('@manual_proxy')).to be_falsey
+ expect(conn.instance_variable_get(:@manual_proxy)).to be_falsey
expect(conn.proxy_for_request('https://google.co.uk').host).to eq('proxy.com')
end
end
it 'uses processes no_proxy before https_proxy' do
with_env 'https_proxy' => 'https://proxy.com', 'no_proxy' => 'google.co.uk' do
conn = Faraday.new
- expect(conn.instance_variable_get('@manual_proxy')).to be_falsey
+ expect(conn.instance_variable_get(:@manual_proxy)).to be_falsey
expect(conn.proxy_for_request('https://google.co.uk')).to be_nil
end
end
it 'gives priority to manually set proxy' do
with_env 'https_proxy' => 'https://proxy.com', 'no_proxy' => 'google.co.uk' do
conn = Faraday.new
conn.proxy = 'http://proxy2.com'
- expect(conn.instance_variable_get('@manual_proxy')).to be_truthy
+ expect(conn.instance_variable_get(:@manual_proxy)).to be_truthy
expect(conn.proxy_for_request('https://google.co.uk').host).to eq('proxy2.com')
end
end
it 'ignores env proxy if set that way' do
@@ -578,10 +578,10 @@
expect(req.options.proxy.uri.host).to eq('proxy.com')
end
end
conn.get(url)
- expect(conn.instance_variable_get('@temp_proxy')).to be_nil
+ expect(conn.instance_variable_get(:@temp_proxy)).to be_nil
end
it 'dynamically check no proxy' do
with_env 'http_proxy' => 'http://proxy.com', 'no_proxy' => 'example.com' do
expect(conn.proxy.uri.host).to eq('proxy.com')