Class I18nSimpleBackendLoadTranslationsTest
In: vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
Parent: Test::Unit::TestCase

Methods

Included Modules

I18nSimpleBackendTestSetup

Public Instance methods

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 495
495:   def test_load_rb_loads_data_from_ruby_file
496:     data = @backend.send :load_rb, "#{@locale_dir}/en.rb"
497:     assert_equal({'en-Ruby''en-Ruby' => {:foo => {:bar => "baz"}}}, data)
498:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 500
500:   def test_load_rb_loads_data_from_yaml_file
501:     data = @backend.send :load_yml, "#{@locale_dir}/en.yml"
502:     assert_equal({'en-Yaml' => {'foo' => {'bar' => 'baz'}}}, data)
503:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 505
505:   def test_load_translations_loads_from_different_file_formats
506:     @backend = I18n::Backend::Simple.new
507:     @backend.load_translations "#{@locale_dir}/en.rb", "#{@locale_dir}/en.yml"
508:     expected = {
509:       'en-Ruby''en-Ruby' => {:foo => {:bar => "baz"}},
510:       'en-Yaml''en-Yaml' => {:foo => {:bar => "baz"}}
511:     }
512:     assert_equal expected, backend_get_translations
513:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 491
491:   def test_load_translations_with_ruby_file_type_does_not_raise_exception
492:     assert_nothing_raised { @backend.load_translations "#{@locale_dir}/en.rb" }
493:   end

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 487
487:   def test_load_translations_with_unknown_file_type_raises_exception
488:     assert_raise(I18n::UnknownFileType) { @backend.load_translations "#{@locale_dir}/en.xml" }
489:   end

[Validate]