From 484d2aaed7987582612f59d1f0bc4aa07ffd8a1e Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 31 Dec 2010 13:56:07 +0100 Subject: Do not take gems' i18n locales while testing locales paths --- railties/test/railties/shared_tests.rb | 10 ++++++++-- 1 file 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) -- cgit v1.2.3