Sha256: 2a4138dedbb9dab081b70ca8ac633c80bbc99852c59501ed8f5b6154df53d671

Contents?: true

Size: 641 Bytes

Versions: 4

Compression:

Stored size: 641 Bytes

Contents

# encoding: utf-8
require 'test_helper'

class ProxyTest < Test::Unit::TestCase

  def test_uses_proxy_when_specified
    Geocoder.configure(:http_proxy => 'localhost')
    lookup = Geocoder::Lookup::Google.new
    assert lookup.send(:http_client).proxy_class?
  end

  def test_doesnt_use_proxy_when_not_specified
    lookup = Geocoder::Lookup::Google.new
    assert !lookup.send(:http_client).proxy_class?
  end

  def test_exception_raised_on_bad_proxy_url
    Geocoder.configure(:http_proxy => ' \\_O< Quack Quack')
    assert_raise Geocoder::ConfigurationError do
      Geocoder::Lookup::Google.new.send(:http_client)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
geocoder-1.1.8 test/proxy_test.rb
geocoder-1.1.7 test/proxy_test.rb
geocoder-sgonyea-1.1.6.1 test/proxy_test.rb
geocoder-1.1.6 test/proxy_test.rb