Do not take gems' i18n locales while testing locales paths

This commit is contained in:
Piotr Sarnacki
2010-12-31 13:56:07 +01:00
parent 8e5d91062f
commit 484d2aaed7

View File

@@ -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)