Skip to content

Commit

Permalink
renamed states -> provinces
Browse files Browse the repository at this point in the history
  • Loading branch information
phenomen2277 committed Jul 20, 2014
1 parent a20e800 commit a797b97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/yahoo_countries_and_provinces/yahoo_province_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
module YahooCountriesAndProvinces
class YahooProvinceList
def initialize()
@states_array = []
@province_array = []
end

def provinces(country, language = "en")
set_url(country, language)

@states_array.clear if @states_array.any?
@province_array.clear if @province_array.any?
begin
resp = Net::HTTP.get_response(URI.parse(@url))
data = resp.body
Expand All @@ -19,11 +19,11 @@ def provinces(country, language = "en")
raise "Could not get the data from yahoo's servers"
end

result.each { |state|
@states_array << state['name']
result.each { |province|
@province_array << province['name']
}

@states_array
@province_array
end

private
Expand Down
4 changes: 2 additions & 2 deletions test/yahoo_countries_and_provinces_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def test_get_minor_outlying_islands_united_states_in_german
assert YahooCountriesAndProvinces::countries("de").include?("Kleinere Inselbesitzungen der Vereinigten Staaten")
end

def test_get_state_baghdad_in_english
def test_get_province_baghdad_in_english
assert YahooCountriesAndProvinces::provinces("Iraq", "en").include?("Baghdad")
end

def test_get_state_stockholm_in_arabic
def test_get_province_stockholm_in_arabic
assert YahooCountriesAndProvinces::provinces("Sweden", "ar").include?("ستوكهولم")
end
end

0 comments on commit a797b97

Please sign in to comment.