mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-06 00:03:36 -04:00
Merge branch 'master' of https://github.com/benburkert/faraday into default-fetch-fixes
This commit is contained in:
commit
1b94e96022
@ -48,8 +48,9 @@ module Faraday
|
||||
|
||||
# Public
|
||||
def fetch(key, default = nil)
|
||||
send(key) || send("#{key}=", default ||
|
||||
(block_given? ? Proc.new.call : nil))
|
||||
return send(key) if keys.include?(key)
|
||||
|
||||
send("#{key}=", default || (block_given? ? Proc.new.call : nil))
|
||||
end
|
||||
|
||||
# Public
|
||||
|
@ -164,4 +164,10 @@ class OptionsTest < Faraday::TestCase
|
||||
e["custom"] = :boom
|
||||
assert_equal :boom, e["custom"]
|
||||
end
|
||||
|
||||
def test_env_fetch_ignores_false
|
||||
ssl = Faraday::SSLOptions.new
|
||||
ssl.verify = false
|
||||
assert !ssl.fetch(:verify, true)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user