2 require File.join(File.dirname(__FILE__), '../../../../config/environment')
4 class GeoLocTest < Test::Unit::TestCase #:nodoc: all
7 @loc = GeoKit::GeoLoc.new
12 @loc.country_code = 'US'
16 def test_street_number
17 @loc.street_address = '123 Spear St.'
18 assert_equal '123', @loc.street_number
22 @loc.street_address = '123 Spear St.'
23 assert_equal 'Spear St.', @loc.street_name
27 @loc.city = "san francisco"
28 assert_equal 'San Francisco', @loc.city
32 @loc.city = 'San Francisco'
35 @loc.country_code = 'US'
36 assert_equal 'San Francisco, CA, 94105, US', @loc.full_address
37 @loc.full_address = 'Irving, TX, 75063, US'
38 assert_equal 'Irving, TX, 75063, US', @loc.full_address
42 @loc.city = 'San Francisco'
45 @loc.country_code = 'US'
46 @another = GeoKit::GeoLoc.new @loc.to_hash
47 assert_equal @loc, @another