Improved code layout.
This commit is contained in:
parent
75104e3c46
commit
4eace918d3
2 changed files with 18 additions and 18 deletions
|
@ -6,67 +6,67 @@ class GeoIpCalendar < ActiveSupport::TestCase
|
||||||
# check
|
# check
|
||||||
test 'check some results' do
|
test 'check some results' do
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '127.0.0.0.1' )
|
result = Service::GeoCalendar.location('127.0.0.0.1')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('My Calendar', result['name'])
|
assert_equal('My Calendar', result['name'])
|
||||||
assert_equal('America/Los_Angeles', result['timezone'])
|
assert_equal('America/Los_Angeles', result['timezone'])
|
||||||
assert_equal('', result['ical_url'])
|
assert_equal('', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '127.0.0.1' )
|
result = Service::GeoCalendar.location('127.0.0.1')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('My Calendar', result['name'])
|
assert_equal('My Calendar', result['name'])
|
||||||
assert_equal('America/Los_Angeles', result['timezone'])
|
assert_equal('America/Los_Angeles', result['timezone'])
|
||||||
assert_equal('', result['ical_url'])
|
assert_equal('', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '195.65.29.254' )
|
result = Service::GeoCalendar.location('195.65.29.254')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Switzerland', result['name'])
|
assert_equal('Switzerland', result['name'])
|
||||||
assert_equal('Europe/Zurich', result['timezone'])
|
assert_equal('Europe/Zurich', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/de.ch%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/de.ch%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '195.191.132.18' )
|
result = Service::GeoCalendar.location('195.191.132.18')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Switzerland', result['name'])
|
assert_equal('Switzerland', result['name'])
|
||||||
assert_equal('Europe/Zurich', result['timezone'])
|
assert_equal('Europe/Zurich', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/de.ch%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/de.ch%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '134.109.140.74' )
|
result = Service::GeoCalendar.location('134.109.140.74')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Germany', result['name'])
|
assert_equal('Germany', result['name'])
|
||||||
assert_equal('Europe/Berlin', result['timezone'])
|
assert_equal('Europe/Berlin', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/de.german%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/de.german%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '46.253.55.170' )
|
result = Service::GeoCalendar.location('46.253.55.170')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Germany', result['name'])
|
assert_equal('Germany', result['name'])
|
||||||
assert_equal('Europe/Berlin', result['timezone'])
|
assert_equal('Europe/Berlin', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/de.german%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/de.german%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '169.229.216.200' )
|
result = Service::GeoCalendar.location('169.229.216.200')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States/California', result['name'])
|
assert_equal('United States/California', result['name'])
|
||||||
assert_equal('America/Los_Angeles', result['timezone'])
|
assert_equal('America/Los_Angeles', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '17.171.2.25' )
|
result = Service::GeoCalendar.location('17.171.2.25')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States/California', result['name'])
|
assert_equal('United States/California', result['name'])
|
||||||
assert_equal('America/Los_Angeles', result['timezone'])
|
assert_equal('America/Los_Angeles', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '184.168.47.225' )
|
result = Service::GeoCalendar.location('184.168.47.225')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States/Arizona', result['name'])
|
assert_equal('United States/Arizona', result['name'])
|
||||||
assert_equal('America/Phoenix', result['timezone'])
|
assert_equal('America/Phoenix', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '69.172.201.245' )
|
result = Service::GeoCalendar.location('69.172.201.245')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States/New York', result['name'])
|
assert_equal('United States/New York', result['name'])
|
||||||
assert_equal('America/New_York', result['timezone'])
|
assert_equal('America/New_York', result['timezone'])
|
||||||
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
assert_equal('http://www.google.com/calendar/ical/en.usa%23holiday%40group.v.calendar.google.com/public/basic.ics', result['ical_url'])
|
||||||
|
|
||||||
result = Service::GeoCalendar.location( '132.247.70.37' )
|
result = Service::GeoCalendar.location('132.247.70.37')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Mexico/Sonora', result['name'])
|
assert_equal('Mexico/Sonora', result['name'])
|
||||||
assert_equal('America/Hermosillo', result['timezone'])
|
assert_equal('America/Hermosillo', result['timezone'])
|
||||||
|
|
|
@ -6,7 +6,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
# check
|
# check
|
||||||
test 'check some results' do
|
test 'check some results' do
|
||||||
|
|
||||||
result = Service::GeoIp.location( '127.0.0.0.1' )
|
result = Service::GeoIp.location('127.0.0.0.1')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal(nil, result['country_name'])
|
assert_equal(nil, result['country_name'])
|
||||||
assert_equal(nil, result['city_name'])
|
assert_equal(nil, result['city_name'])
|
||||||
|
@ -15,7 +15,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(nil, result['latitude'])
|
assert_equal(nil, result['latitude'])
|
||||||
assert_equal(nil, result['longitude'])
|
assert_equal(nil, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '127.0.0.1' )
|
result = Service::GeoIp.location('127.0.0.1')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal(nil, result['country_name'])
|
assert_equal(nil, result['country_name'])
|
||||||
assert_equal(nil, result['city_name'])
|
assert_equal(nil, result['city_name'])
|
||||||
|
@ -24,7 +24,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(nil, result['latitude'])
|
assert_equal(nil, result['latitude'])
|
||||||
assert_equal(nil, result['longitude'])
|
assert_equal(nil, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '195.65.29.254' )
|
result = Service::GeoIp.location('195.65.29.254')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Switzerland', result['country_name'])
|
assert_equal('Switzerland', result['country_name'])
|
||||||
assert_equal('Regensdorf', result['city_name'])
|
assert_equal('Regensdorf', result['city_name'])
|
||||||
|
@ -33,7 +33,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(47.4319, result['latitude'])
|
assert_equal(47.4319, result['latitude'])
|
||||||
assert_equal(8.4658, result['longitude'])
|
assert_equal(8.4658, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '134.109.140.74' )
|
result = Service::GeoIp.location('134.109.140.74')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Germany', result['country_name'])
|
assert_equal('Germany', result['country_name'])
|
||||||
assert_equal('Chemnitz', result['city_name'])
|
assert_equal('Chemnitz', result['city_name'])
|
||||||
|
@ -42,7 +42,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(50.8333, result['latitude'])
|
assert_equal(50.8333, result['latitude'])
|
||||||
assert_equal(12.9167, result['longitude'])
|
assert_equal(12.9167, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '46.253.55.170' )
|
result = Service::GeoIp.location('46.253.55.170')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('Germany', result['country_name'])
|
assert_equal('Germany', result['country_name'])
|
||||||
assert_equal('Halle', result['city_name'])
|
assert_equal('Halle', result['city_name'])
|
||||||
|
@ -51,7 +51,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(51.5034, result['latitude'])
|
assert_equal(51.5034, result['latitude'])
|
||||||
assert_equal(11.9622, result['longitude'])
|
assert_equal(11.9622, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '169.229.216.200' )
|
result = Service::GeoIp.location('169.229.216.200')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States', result['country_name'])
|
assert_equal('United States', result['country_name'])
|
||||||
assert_equal('Berkeley', result['city_name'])
|
assert_equal('Berkeley', result['city_name'])
|
||||||
|
@ -60,7 +60,7 @@ class GeoIpTest < ActiveSupport::TestCase
|
||||||
assert_equal(37.8668, result['latitude'])
|
assert_equal(37.8668, result['latitude'])
|
||||||
assert_equal(-122.2536, result['longitude'])
|
assert_equal(-122.2536, result['longitude'])
|
||||||
|
|
||||||
result = Service::GeoIp.location( '17.171.2.25' )
|
result = Service::GeoIp.location('17.171.2.25')
|
||||||
assert(result)
|
assert(result)
|
||||||
assert_equal('United States', result['country_name'])
|
assert_equal('United States', result['country_name'])
|
||||||
assert_equal('Cupertino', result['city_name'])
|
assert_equal('Cupertino', result['city_name'])
|
||||||
|
|
Loading…
Reference in a new issue