From 4978eff8be1e68802b26995deb1c0df3035b0c37 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Mon, 12 Sep 2011 10:12:09 -0400 Subject: [PATCH] Test exceptions with all lookups. --- test/error_handling_test.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/error_handling_test.rb b/test/error_handling_test.rb index e60c7b39..f9d1f41a 100644 --- a/test/error_handling_test.rb +++ b/test/error_handling_test.rb @@ -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 -- GitLab