Class: I18nSimpleBackendReloadTranslationsTest

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

#setupObject



544
545
546
547
548
549
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 544

def setup
  @backend = I18n::Backend::Simple.new
  I18n.load_path = [File.dirname(__FILE__) + '/locale/en.yml']
  assert_nil backend_get_translations
  @backend.send :init_translations
end

#teardownObject



551
552
553
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 551

def teardown
  I18n.load_path = []
end

#test_reload_translations_uninitializes_translationsObject



564
565
566
567
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 564

def test_reload_translations_uninitializes_translations
  @backend.reload!
  assert_equal @backend.initialized?, false
end

#test_reload_translations_unloads_translationsObject



559
560
561
562
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 559

def test_reload_translations_unloads_translations
  @backend.reload!
  assert_nil backend_get_translations
end

#test_setupObject



555
556
557
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 555

def test_setup
  assert_not_nil backend_get_translations
end