Skip to content

Commit

Permalink
remove locales external to the system before assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 12, 2011
1 parent 16ae08f commit 31293ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions railties/test/railties/shared_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def test_i18n_files_have_lower_priority_than_application_ones

boot_rails

expected = %W(
expected_locales = %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
Expand All @@ -304,11 +304,11 @@ def test_i18n_files_have_lower_priority_than_application_ones
#{app_path}/app/locales/en.yml
).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
actual_locales = I18n.load_path.map { |path|
File.expand_path(path)
} & expected_locales # remove locales external to Rails

assert_equal expected, actual
assert_equal expected_locales, actual_locales

assert_equal "2", I18n.t(:foo)
assert_equal "1", I18n.t(:bar)
Expand Down

0 comments on commit 31293ba

Please sign in to comment.