Class: I18nSimpleBackendTranslationsTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
I18nSimpleBackendTestSetup
Defined in:
lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb

Instance Method Summary collapse

Methods included from I18nSimpleBackendTestSetup

#add_datetime_translations, #backend_get_translations, #setup_backend

Instance Method Details

#test_store_translations_adds_translationsObject

no, really :-)



103
104
105
106
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 103

def test_store_translations_adds_translations # no, really :-)
  @backend.store_translations :'en', :foo => 'bar'
  assert_equal Hash[:'en', {:foo => 'bar'}], backend_get_translations
end

#test_store_translations_converts_keys_to_symbolsObject



119
120
121
122
123
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 119

def test_store_translations_converts_keys_to_symbols
  # backend_reset_translations!
  @backend.store_translations 'en', 'foo' => {'bar' => 'bar', 'baz' => 'baz'}
  assert_equal Hash[:'en', {:foo => {:bar => 'bar', :baz => 'baz'}}], backend_get_translations
end

#test_store_translations_deep_merges_translationsObject



108
109
110
111
112
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 108

def test_store_translations_deep_merges_translations
  @backend.store_translations :'en', :foo => {:bar => 'bar'}
  @backend.store_translations :'en', :foo => {:baz => 'baz'}
  assert_equal Hash[:'en', {:foo => {:bar => 'bar', :baz => 'baz'}}], backend_get_translations
end

#test_store_translations_forces_locale_to_symObject



114
115
116
117
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 114

def test_store_translations_forces_locale_to_sym
  @backend.store_translations 'en', :foo => 'bar'
  assert_equal Hash[:'en', {:foo => 'bar'}], backend_get_translations
end