Class: I18nLoadPathTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/vendor/i18n/test/i18n_load_path_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject

include Tests::Backend::Simple::Setup::Base



8
9
10
11
12
# File 'lib/vendor/i18n/test/i18n_load_path_test.rb', line 8

def setup
  I18n.locale = :en
  I18n.backend = I18n::Backend::Simple.new
  backend_store_translations(:en, :foo => {:bar => 'bar', :baz => 'baz'})
end

#test_adding_arrays_of_filenames_to_load_path_do_not_break_locale_loadingObject



19
20
21
22
# File 'lib/vendor/i18n/test/i18n_load_path_test.rb', line 19

def test_adding_arrays_of_filenames_to_load_path_do_not_break_locale_loading
  I18n.load_path << Dir[locales_dir + '/*.{rb,yml}']
  assert_equal "baz", I18n.t(:'foo.bar')
end

#test_nested_load_paths_do_not_break_locale_loadingObject



14
15
16
17
# File 'lib/vendor/i18n/test/i18n_load_path_test.rb', line 14

def test_nested_load_paths_do_not_break_locale_loading
  I18n.load_path = [[locales_dir + '/en.yml']]
  assert_equal "baz", I18n.t(:'foo.bar')
end