aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2009-01-08 22:14:24 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-25 22:51:21 -0600
commit5c062bf1000886d26b3a4c3b08dfb6618a4adcdf (patch)
treeeef5a62305f248ef4683c3d28a92d46cc2c9cf03 /activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb
parentf4bf318db061daa8c6ebb2b700fd15034e031310 (diff)
downloadrails-5c062bf1000886d26b3a4c3b08dfb6618a4adcdf.tar.gz
rails-5c062bf1000886d26b3a4c3b08dfb6618a4adcdf.tar.bz2
rails-5c062bf1000886d26b3a4c3b08dfb6618a4adcdf.zip
add #available_locales to I18n and I18n::SimpleBackend, flatten translations load_path when loading translations [#1714 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb')
-rw-r--r--activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb b/activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb
index e181975f38..8ba7036abf 100644
--- a/activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.1.1/test/simple_backend_test.rb
@@ -124,6 +124,16 @@ class I18nSimpleBackendTranslationsTest < Test::Unit::TestCase
end
end
+class I18nSimpleBackendAvailableLocalesTest < Test::Unit::TestCase
+ def test_available_locales
+ @backend = I18n::Backend::Simple.new
+ @backend.store_translations 'de', :foo => 'bar'
+ @backend.store_translations 'en', :foo => 'foo'
+
+ assert_equal ['de', 'en'], @backend.available_locales.map{|locale| locale.to_s }.sort
+ end
+end
+
class I18nSimpleBackendTranslateTest < Test::Unit::TestCase
include I18nSimpleBackendTestSetup
@@ -472,6 +482,18 @@ class I18nSimpleBackendLoadTranslationsTest < Test::Unit::TestCase
end
end
+class I18nSimpleBackendLoadPathTest < Test::Unit::TestCase
+ include I18nSimpleBackendTestSetup
+
+ def test_nested_load_paths_do_not_break_locale_loading
+ @backend = I18n::Backend::Simple.new
+ I18n.load_path = [[File.dirname(__FILE__) + '/locale/en.yml']]
+ assert_nil backend_get_translations
+ assert_nothing_raised { @backend.send :init_translations }
+ assert_not_nil backend_get_translations
+ end
+end
+
class I18nSimpleBackendReloadTranslationsTest < Test::Unit::TestCase
include I18nSimpleBackendTestSetup