-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require 'active_support/inflector' | ||
|
||
require 'geo_location/variables' | ||
require 'geo_location/geo_location' | ||
require 'geo_location/version' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module GeoLocation | ||
VERSION = "0.0.1" | ||
VERSION = "0.1.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
require 'geo_location' | ||
|
||
class Test::Unit::TestCase | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
require 'helper' | ||
|
||
class TestGeoLocation < Test::Unit::TestCase | ||
should "probably rename this file and start testing for real" do | ||
flunk "hey buddy, you should probably rename this file and start testing for real" | ||
should "find CA country using hostip" do | ||
GeoLocation::use = :hostip | ||
ip = GeoLocation.find('142.59.52.238') | ||
assert_equal ip[:country], 'CA' | ||
end | ||
|
||
should "find NY region using hostip" do | ||
GeoLocation::use = :hostip | ||
ip = GeoLocation.find('24.24.24.24') | ||
assert_equal ip[:region], 'NY' | ||
end | ||
|
||
should "find Edmonton city using hostip" do | ||
GeoLocation::use = :hostip | ||
ip = GeoLocation.find('142.59.52.238') | ||
assert_equal ip[:city], 'Edmonton' | ||
end | ||
end |