Class: I18nSimpleBackendLoadPathTest

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

#teardownObject



519
520
521
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 519

def teardown
  I18n.load_path = []
end

#test_adding_arrays_of_filenames_to_load_path_do_not_break_locale_loadingObject



531
532
533
534
535
536
537
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 531

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



523
524
525
526
527
528
529
# File 'lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb', line 523

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