aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-12-31 13:56:07 +0100
committerPiotr Sarnacki <drogus@gmail.com>2010-12-31 13:56:07 +0100
commit484d2aaed7987582612f59d1f0bc4aa07ffd8a1e (patch)
tree1d0966db97ff684d77877a69bab086893977d5da
parent8e5d91062f25f8c97a3bd8c6dc7dc45e38b54388 (diff)
downloadrails-484d2aaed7987582612f59d1f0bc4aa07ffd8a1e.tar.gz
rails-484d2aaed7987582612f59d1f0bc4aa07ffd8a1e.tar.bz2
rails-484d2aaed7987582612f59d1f0bc4aa07ffd8a1e.zip
Do not take gems' i18n locales while testing locales paths
-rw-r--r--railties/test/railties/shared_tests.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/test/railties/shared_tests.rb b/railties/test/railties/shared_tests.rb
index 31ba2eaca2..a162bdb66f 100644
--- a/railties/test/railties/shared_tests.rb
+++ b/railties/test/railties/shared_tests.rb
@@ -294,7 +294,7 @@ YAML
boot_rails
- assert_equal %W(
+ expected = %W(
#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activemodel/lib/active_model/locale/en.yml
#{RAILS_FRAMEWORK_ROOT}/activerecord/lib/active_record/locale/en.yml
@@ -302,7 +302,13 @@ YAML
#{@plugin.path}/config/locales/en.yml
#{app_path}/config/locales/en.yml
#{app_path}/app/locales/en.yml
- ).map { |path| File.expand_path(path) }, I18n.load_path.map { |path| File.expand_path(path) }
+ ).map { |path| File.expand_path(path) }
+
+ actual = I18n.load_path.map { |path| File.expand_path(path) }.find_all do |p|
+ p =~ /^#{RAILS_FRAMEWORK_ROOT}/ || p =~ /^#{@plugin.path}/ || p =~ /^#{app_path}/
+ end
+
+ assert_equal expected, actual
assert_equal "2", I18n.t(:foo)
assert_equal "1", I18n.t(:bar)