Skip to content

Commit

Permalink
Test #available_locales delegates to backend more precisely
Browse files Browse the repository at this point in the history
  • Loading branch information
paarthmadan committed Feb 3, 2022
1 parent ace1e9c commit 9ec31b0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/i18n/tests/basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ def teardown
I18n.available_locales = nil
end

test "available_locales returns the locales stored to the backend by default" do
test "available_locales returns the available_locales produced by the backend, by default" do
I18n.backend.store_translations('de', :foo => 'bar')
I18n.backend.store_translations('en', :foo => 'foo')

assert I18n.available_locales.include?(:de)
assert I18n.available_locales.include?(:en)
assert_equal I18n.available_locales, I18n.backend.available_locales
end

test "available_locales can be set to something else independently from the actual locale data" do
Expand All @@ -24,8 +23,7 @@ def teardown
assert_equal [:foo, :bar], I18n.available_locales

I18n.available_locales = nil
assert I18n.available_locales.include?(:de)
assert I18n.available_locales.include?(:en)
assert_equal I18n.available_locales, I18n.backend.available_locales
end

test "available_locales memoizes when set explicitely" do
Expand Down

0 comments on commit 9ec31b0

Please sign in to comment.