Permalink
Browse files

Merge pull request #546 from ZogStriP/improve-i18n-spec-speed

prevent double work in the i18n integrity specs
  • Loading branch information...
eviltrout committed Mar 24, 2013
2 parents 5b9ff91 + c98d583 commit 3cb729df2187942bc1410dc3b2e0bfc52d15ceeb
Showing with 7 additions and 3 deletions.
  1. +7 −3 spec/integrity/i18n_spec.rb
@@ -21,17 +21,21 @@
end
end
- it "has valid YAML for client and server" do
- Dir["#{Rails.root}/config/locales/*.yml"].each do |f|
+ it "has valid YAML for client" do
+ Dir["#{Rails.root}/config/locales/client.*.yml"].each do |f|
locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
-
client = YAML.load_file("#{Rails.root}/config/locales/client.#{locale}.yml")
client.count.should == 1
client[locale].should_not == nil
client[locale].count.should == 2
client[locale]["js"].should_not == nil
client[locale]["admin_js"].should_not == nil
+ end
+ end
+ it "has valid YAML for server" do
+ Dir["#{Rails.root}/config/locales/server.*.yml"].each do |f|
+ locale = /.*\.([^.]{2,})\.yml$/.match(f)[1]
server = YAML.load_file("#{Rails.root}/config/locales/server.#{locale}.yml")
server.count.should == 1
server[locale].should_not == nil

0 comments on commit 3cb729d

Please sign in to comment.