Permalink
Browse files

bumping version and adding better tests

  • Loading branch information...
1 parent 5a5ca4e commit afc78cd89ee42e52b424f8b57966e4bb918e1e04 @onomojo committed Jul 25, 2012
View
@@ -1,13 +1,16 @@
PATH
remote: .
specs:
- i18n-country-translations (0.0.6)
+ i18n-country-translations (0.0.8)
i18n (~> 0.5)
railties (>= 3.0.0)
GEM
remote: http://rubygems.org/
specs:
+ actionmailer (3.2.2)
+ actionpack (= 3.2.2)
+ mail (~> 2.4.0)
actionpack (3.2.2)
activemodel (= 3.2.2)
activesupport (= 3.2.2)
@@ -21,9 +24,18 @@ GEM
activemodel (3.2.2)
activesupport (= 3.2.2)
builder (~> 3.0.0)
+ activerecord (3.2.2)
+ activemodel (= 3.2.2)
+ activesupport (= 3.2.2)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.2)
+ activemodel (= 3.2.2)
+ activesupport (= 3.2.2)
activesupport (3.2.2)
i18n (~> 0.6)
multi_json (~> 1.0)
+ arel (3.0.2)
builder (3.0.0)
diff-lcs (1.1.3)
erubis (2.7.0)
@@ -33,14 +45,28 @@ GEM
i18n-spec (0.1.2)
journey (1.0.3)
json (1.6.5)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.18)
multi_json (1.1.0)
+ polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
+ rails (3.2.2)
+ actionmailer (= 3.2.2)
+ actionpack (= 3.2.2)
+ activerecord (= 3.2.2)
+ activeresource (= 3.2.2)
+ activesupport (= 3.2.2)
+ bundler (~> 1.0)
+ railties (= 3.2.2)
railties (3.2.2)
actionpack (= 3.2.2)
activesupport (= 3.2.2)
@@ -71,6 +97,10 @@ GEM
tilt (~> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
PLATFORMS
ruby
@@ -79,5 +109,6 @@ DEPENDENCIES
hpricot
i18n-country-translations!
i18n-spec (>= 0.1.1)
+ rails (>= 3.0.0)
rspec-rails (>= 2.7.0)
spork (~> 1.0rc)
View
@@ -40,6 +40,7 @@ You can also use these standard translations to help if you don't want to use th
* Joost Hietbrink - http://blog.joopp.com
* Janko Marohnić - https://github.com/janko-m
* Cyril Mougel - https://github.com/shingara
+* Kamil Politowicz - https://github.com/kpolitowicz
== Related
You may also be intersted in the i18n_country_select gem which basically gives you a helper to make use of these translations in a coutry select dropdown.
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
s.add_dependency('i18n', '~> 0.5')
s.add_dependency "railties", ">= 3.0.0"
+ s.add_development_dependency "rails", ">= 3.0.0"
s.add_development_dependency "rspec-rails", ">= 2.7.0"
s.add_development_dependency "i18n-spec", ">= 0.1.1"
s.add_development_dependency "spork", "~> 1.0rc"
@@ -1,3 +1,3 @@
module I18nCountryTranslations
- VERSION = "0.0.7"
+ VERSION = "0.0.8"
end
View
@@ -5,8 +5,19 @@
require 'i18n/core_ext/hash'
require 'active_support/core_ext/kernel/reporting'
require 'support/fake_app'
+require 'rails/all'
RSpec.configure do |config|
config.mock_with :rspec
config.fail_fast = true
-end
+end
+
+module Config
+ class Application < ::Rails::Application
+ # configuration here if needed
+ config.active_support.deprecation = :stderr
+ end
+end
+
+# Initialize the application
+Config::Application.initialize!
@@ -1,10 +1,16 @@
-# coding: utf-8
-
require 'spec_helper'
Dir.glob('rails/locale/*.yml') do |locale_file|
describe "a i18n-country-translations #{locale_file} locale file" do
it_behaves_like 'a valid locale file', locale_file
it { locale_file.should be_a_subset_of('rails/locale/en.yml') }
+
+ I18n.locale = locale_file.split('/').last.split('.').first
+ translations = I18n.backend.send(:translations)
+ translations.keys.each do |country_code|
+ p I18n.t(country_code, :scope => :countries, :separator => "\001") if I18n.t(country_code, :scope => :countries, :separator => "\001").include?('translation missing')
+ it { I18n.t(country_code, :scope => :countries, :separator => "\001").should_not == country_code }
+ it { I18n.t(country_code, :scope => :countries, :separator => "\001").include?('translation missing').should == false }
+ end
end
-end
+end

0 comments on commit afc78cd

Please sign in to comment.