Merge branch 'master' into fix/rubocop-linting-more

This commit is contained in:
Olle Jonsson 2019-02-27 20:52:45 +01:00 committed by GitHub
commit 64d9002b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 13 deletions

View File

@ -738,15 +738,6 @@ Style/UnlessElse:
- 'lib/faraday/adapter/em_http.rb'
- 'lib/faraday/adapter/em_http_ssl_patch.rb'
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
Exclude:
- 'script/generate_certs'
- 'spec/faraday/request/url_encoded_spec.rb'
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
@ -757,7 +748,7 @@ Style/YodaCondition:
- 'script/proxy-server'
- 'test/helper.rb'
# Offense count: 273
# Offense count: 272
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:

View File

@ -33,7 +33,7 @@ def write(file, contents, env_var)
end
# One cert / CA for ease of testing when ignoring verification
cert, key = create_self_signed_cert(1024, [['CN', 'localhost']], 'Faraday Test CA')
cert, key = create_self_signed_cert(1024, [%w[CN localhost]], 'Faraday Test CA')
write 'tmp/faraday-cert.key', key, 'SSL_KEY'
write 'tmp/faraday-cert.crt', cert, 'SSL_FILE'

View File

@ -46,11 +46,11 @@ RSpec.describe Faraday::Request::UrlEncoded do
end
it 'works with non nested params' do
response = conn.post('/echo', { dimensions: ['date', 'location'] }) do |req|
response = conn.post('/echo', { dimensions: %w[date location] }) do |req|
req.options.params_encoder = Faraday::FlatParamsEncoder
end
expect(response.headers['Content-Type']).to eq('application/x-www-form-urlencoded')
expected = { 'dimensions' => ['date', 'location'] }
expected = { 'dimensions' => %w[date location] }
expect(Faraday::Utils.parse_query(response.body)).to eq(expected)
expect(response.body).to eq('dimensions=date&dimensions=location')
end