Skip to content

Commit

Permalink
Added failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iMacTia committed Dec 5, 2017
1 parent 50d03b8 commit bf1a28c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/connection_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ def test_dynamic_proxy
end
end

def test_nil_proxy_overrides_env
with_env 'http_proxy' => 'http://duncan.proxy.com:80' do
conn = Faraday::Connection.new(proxy: nil)
assert_nil conn.proxy
end
end

if URI.parse('').respond_to?(:find_proxy)
def test_proxy_allowed_when_url_in_no_proxy_list
with_env 'http_proxy' => 'http://proxy.com', 'no_proxy' => 'example.com' do
Expand Down
5 changes: 5 additions & 0 deletions test/options_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def test_proxy_options_from_string
assert_equal 'http', options.scheme
end

def test_proxy_options_from_nil
options = Faraday::ProxyOptions.from nil
assert_nil options
end

def test_proxy_options_hash_access
proxy = Faraday::ProxyOptions.from 'http://a%40b:pw%20d@example.org'
assert_equal 'a@b', proxy[:user]
Expand Down

0 comments on commit bf1a28c

Please sign in to comment.