From 9ec31b05a64e2344967d3089cf9cc786f1323a49 Mon Sep 17 00:00:00 2001 From: Paarth Madan Date: Wed, 2 Feb 2022 19:45:47 -0500 Subject: [PATCH] Test #available_locales delegates to backend more precisely --- lib/i18n/tests/basics.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/i18n/tests/basics.rb b/lib/i18n/tests/basics.rb index 951d7ab5..be824302 100644 --- a/lib/i18n/tests/basics.rb +++ b/lib/i18n/tests/basics.rb @@ -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 @@ -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