Class: I18nSimpleBackendLoadPathTest

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

#teardownObject



520
521
522
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 520

def teardown
  I18n.load_path = []
end

#test_adding_arrays_of_filenames_to_load_path_do_not_break_locale_loadingObject



532
533
534
535
536
537
538
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 532

def test_adding_arrays_of_filenames_to_load_path_do_not_break_locale_loading
  @backend = I18n::Backend::Simple.new
  I18n.load_path << Dir[File.dirname(__FILE__) + '/locale/*.{rb,yml}']
  assert_nil backend_get_translations
  assert_nothing_raised { @backend.send :init_translations }
  assert_not_nil backend_get_translations
end

#test_nested_load_paths_do_not_break_locale_loadingObject



524
525
526
527
528
529
530
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 524

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