Class: I18nSimpleBackendTranslationsTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
I18nSimpleBackendTestSetup
Defined in:
lib/vendor/i18n/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 :-)



104
105
106
107
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 104

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



120
121
122
123
124
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 120

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



109
110
111
112
113
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 109

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



115
116
117
118
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 115

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