Sha256: 97e305967bbec7ea3e9d608713f974e5ba0d29708b204caf3297cf6574966607

Contents?: true

Size: 645 Bytes

Versions: 9

Compression:

Stored size: 645 Bytes

Contents

# encoding: utf-8
require 'test_helper'

class ProxyTest < Test::Unit::TestCase

  def test_uses_proxy_when_specified
    Geocoder::Configuration.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::Configuration.http_proxy = ' \\_O< Quack Quack'
    assert_raise Geocoder::ConfigurationError do
      Geocoder::Lookup::Google.new.send(:http_client)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
geocoder-1.1.5 test/proxy_test.rb
geocoder-1.1.4 test/proxy_test.rb
geocoder-1.1.3 test/proxy_test.rb
geocoder-1.1.2 test/proxy_test.rb
geocoder-1.1.1 test/proxy_test.rb
geocoder-1.1.0 test/proxy_test.rb
geocoder-1.0.5 test/proxy_test.rb
geocoder-1.0.4 test/proxy_test.rb
geocoder-1.0.3 test/proxy_test.rb