Sha256: 6deb24ab49f95fb6853ecdeb4ed93850b1057208846e541e759e2675f2b44d12

Contents?: true

Size: 688 Bytes

Versions: 8

Compression:

Stored size: 688 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
    backend_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

8 entries across 8 versions & 4 rubygems

Version Path
pepe-i18n-0.2.0 test/i18n_load_path_test.rb
thedarkone-i18n-0.2.0 test/i18n_load_path_test.rb
polish-0.0.5 lib/vendor/i18n/test/i18n_load_path_test.rb
polish-0.0.4 lib/vendor/i18n/test/i18n_load_path_test.rb
polish-0.0.3 lib/vendor/i18n/test/i18n_load_path_test.rb
polish-0.0.2 lib/vendor/i18n/test/i18n_load_path_test.rb
i18n-0.3.0 test/i18n_load_path_test.rb
polish-0.0.1 lib/vendor/i18n/test/i18n_load_path_test.rb