Sha256: b421583bd8c6da32fd612e2a27f1fb6fb7c29b98c4d17cb336c420ff755b7f75

Contents?: true

Size: 693 Bytes

Versions: 4

Compression:

Stored size: 693 Bytes

Contents

# encoding: utf-8
$:.unshift File.expand_path(File.dirname(__FILE__) + '/')
require '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 & 1 rubygems

Version Path
i18n-0.3.6 test/i18n_load_path_test.rb
i18n-0.3.6.pre test/i18n_load_path_test.rb
i18n-0.3.5 test/i18n_load_path_test.rb
i18n-0.3.4 test/i18n_load_path_test.rb