mirror of
https://github.com/lostisland/faraday.git
synced 2025-12-05 00:02:56 -05:00
Merge pull request #231 from lucasmazza/struct-members
Convert Env keys to symbols
This commit is contained in:
commit
b9e89c7562
@ -67,7 +67,7 @@ module Faraday
|
|||||||
hash = {}
|
hash = {}
|
||||||
members.each do |key|
|
members.each do |key|
|
||||||
value = send(key)
|
value = send(key)
|
||||||
hash[key] = value if value
|
hash[key.to_sym] = value if value
|
||||||
end
|
end
|
||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|||||||
@ -184,6 +184,9 @@ class ResponseTest < Faraday::TestCase
|
|||||||
hash = @response.to_hash
|
hash = @response.to_hash
|
||||||
assert_kind_of Hash, hash
|
assert_kind_of Hash, hash
|
||||||
assert_equal @env.to_hash, hash
|
assert_equal @env.to_hash, hash
|
||||||
|
assert_equal hash[:status], @response.status
|
||||||
|
assert_equal hash[:response_headers], @response.headers
|
||||||
|
assert_equal hash[:body], @response.body
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user