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

Test exceptions with all lookups.

parent c394f916
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,23 @@ class ErrorHandlingTest < Test::Unit::TestCase
def test_always_raise_timeout_error
Geocoder::Configuration.always_raise = [TimeoutError]
assert_raise(TimeoutError) { Geocoder.search("timeout") }
all_lookups.each do |l|
lookup = Geocoder.send(:get_lookup, l)
assert_raises TimeoutError do
lookup.send(:results, "timeout")
end
end
Geocoder::Configuration.always_raise = []
end
def test_always_raise_socket_error
Geocoder::Configuration.always_raise = [SocketError]
assert_raise(SocketError) { Geocoder.search("socket_error") }
all_lookups.each do |l|
lookup = Geocoder.send(:get_lookup, l)
assert_raises SocketError do
lookup.send(:results, "socket_error")
end
end
Geocoder::Configuration.always_raise = []
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