Skip to content
Snippets Groups Projects
Commit a25e3d7b authored by Alex Reisner's avatar Alex Reisner
Browse files

Add more useful/specific integration tests.

parent 1c54c7f4
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ rdoc/* ...@@ -3,3 +3,4 @@ rdoc/*
*.gem *.gem
.bundle .bundle
Gemfile.lock Gemfile.lock
api_keys.yml
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[ .. .. lib]))
require 'pathname'
require 'rubygems'
require 'test/unit'
require 'geocoder'
require 'yaml'
class HttpClientTest < Test::Unit::TestCase
def setup
@api_keys = YAML.load_file("api_keys.yml")
end
def test_http_basic_auth
Geocoder.configure(lookup: :geocoder_us, api_key: @api_keys["geocoder_us"])
results = Geocoder.search "27701"
assert_not_nil (r = results.first)
end
def test_ssl
Geocoder.configure(lookup: :esri, use_https: true)
results = Geocoder.search "27701"
assert_not_nil (r = results.first)
end
end
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[ .. .. lib]))
require 'pathname'
require 'rubygems'
require 'test/unit'
require 'geocoder'
class SmokeTest < Test::Unit::TestCase
def test_simple_zip_code_search
result = Geocoder.search "27701"
assert_not_nil (r = result.first)
assert_equal "Durham", r.city
assert_equal "North Carolina", r.state
end
def test_simple_zip_code_search_with_ssl
Geocoder.configure(:use_https => true)
result = Geocoder.search "27701"
assert_not_nil (r = result.first)
assert_equal "Durham", r.city
assert_equal "North Carolina", r.state
ensure
Geocoder.configure(:use_https => false)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment