From bdc4af9b2070e86f859ec50db28776ee84473836 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Sun, 2 Sep 2012 17:56:40 -0400 Subject: [PATCH] Add separate assertion for getting a result at all. --- test/integration/smoke_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/integration/smoke_test.rb b/test/integration/smoke_test.rb index 8d80e1e1..b0c805e6 100644 --- a/test/integration/smoke_test.rb +++ b/test/integration/smoke_test.rb @@ -8,15 +8,17 @@ class SmokeTest < Test::Unit::TestCase def test_simple_zip_code_search result = Geocoder.search "27701" - assert_equal "Durham", result.first.city - assert_equal "North Carolina", result.first.state + 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::Configuration.use_https = true result = Geocoder.search "27701" - assert_equal "Durham", result.first.city - assert_equal "North Carolina", result.first.state + assert_not_nil (r = result.first) + assert_equal "Durham", r.city + assert_equal "North Carolina", r.state ensure Geocoder::Configuration.use_https = false end -- GitLab