countries_ru 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,9 @@
1
+ # encoding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe CountriesRu do
4
5
  it "should return hash of country info by its key" do
5
- CountriesRu['AU'].should be_kind_of(Hash)
6
+ CountriesRu['AU'].should be_kind_of(CountriesRu::Country)
6
7
  end
7
8
 
8
9
  describe "#keys" do
@@ -14,6 +15,30 @@ describe CountriesRu do
14
15
  describe "#each" do
15
16
  it "should proxy to .each of countries hash" do
16
17
  CountriesRu.each.should be_kind_of(Enumerator)
18
+
19
+ countries = []
20
+ CountriesRu.each {|key, country| countries.push(country)}
21
+ countries.should_not be_empty
22
+ end
23
+ end
24
+
25
+ describe "#map" do
26
+ it "should proxy to .each of countries hash" do
27
+ CountriesRu.map.should be_kind_of(Enumerator)
28
+
29
+ CountriesRu.map {|key, country| country }.should_not be_empty
17
30
  end
18
31
  end
32
+
33
+ describe "element of hash" do
34
+ subject { CountriesRu['AU'] }
35
+ its(:name) { should eq("Австралия") }
36
+ its(:fullname) { should eq("") }
37
+ its(:english) { should eq("Australia") }
38
+ its(:alpha2) { should eq("AU") }
39
+ its(:alpha3) { should eq("AUS") }
40
+ its(:iso) { should eq("036") }
41
+ its(:location) { should eq("Океания") }
42
+ its(:location_precise) { should eq("Австралия и Новая Зеландия") }
43
+ end
19
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: countries_ru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -75,6 +75,7 @@ files:
75
75
  - Rakefile
76
76
  - countries_ru.gemspec
77
77
  - lib/countries_ru.rb
78
+ - lib/countries_ru/country.rb
78
79
  - lib/countries_ru/version.rb
79
80
  - lib/data/countries.yml
80
81
  - spec/countries_ru_spec.rb
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  version: '0'
100
101
  requirements: []
101
102
  rubyforge_project:
102
- rubygems_version: 1.8.24
103
+ rubygems_version: 1.8.25
103
104
  signing_key:
104
105
  specification_version: 3
105
106
  summary: Gives you a country object full of all sorts of useful information in russian