Sha256: c4de7b9aeeb546436cc0cd3853b07e97cac0090eda86c4f27ec02bc21fa3488f

Contents?: true

Size: 683 Bytes

Versions: 4

Compression:

Stored size: 683 Bytes

Contents

# encoding: utf-8

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

class I18nLoadPathTest < Test::Unit::TestCase
  # include Tests::Backend::Simple::Setup::Base
  
  def setup
    I18n.locale = :en
    I18n.backend = I18n::Backend::Simple.new
    store_translations(:en, :foo => {:bar => 'bar', :baz => 'baz'})
  end

  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

  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
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
activesupport-2.3.6.pre lib/active_support/vendor/i18n-0.3.3/test/cases/i18n_load_path_test.rb
i18n-0.3.3 test/cases/i18n_load_path_test.rb
i18n-0.3.2 test/cases/i18n_load_path_test.rb
i18n-0.3.1 test/cases/i18n_load_path_test.rb