continents 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,5 +24,10 @@ module Ravibhim
24
24
  def self.get_continent(country)
25
25
  COUNTRY_TO_CONTINENT[country]
26
26
  end
27
+
28
+ def self.get_countries(cont)
29
+ cont_const_name = cont.upcase.gsub(' ','_')
30
+ const_get("#{cont_const_name}_COUNTRIES")
31
+ end
27
32
  end
28
33
  end
@@ -76,4 +76,14 @@ describe "Continents" do
76
76
  end
77
77
  end
78
78
 
79
+ describe :get_countries do
80
+ it 'returns the countries in a continent' do
81
+ Ravibhim::Continents::get_countries('Asia').should include('India')
82
+ Ravibhim::Continents::get_countries('Asia').should include('Sri Lanka')
83
+
84
+ Ravibhim::Continents::get_countries('North America').should include('United States of America')
85
+ Ravibhim::Continents::get_countries('Europe').should include('Germany')
86
+ end
87
+ end
88
+
79
89
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ravi Bhim
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-08 00:00:00 -07:00
17
+ date: 2010-07-16 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency