3
class I18nLoadPathTest < Test::Unit::TestCase
6
I18n.backend = I18n::Backend::Simple.new
7
store_translations(:en, :foo => {:bar => 'bar', :baz => 'baz'})
10
test "nested load paths do not break locale loading" do
11
I18n.load_path = [[locales_dir + '/en.yml']]
12
assert_equal "baz", I18n.t(:'foo.bar')
15
test "loading an empty yml file raises an InvalidLocaleData exception" do
16
assert_raise I18n::InvalidLocaleData do
17
I18n.load_path = [[locales_dir + '/invalid/empty.yml']]
18
I18n.t(:'foo.bar', :default => "baz")
22
test "adding arrays of filenames to the load path does not break locale loading" do
23
I18n.load_path << Dir[locales_dir + '/*.{rb,yml}']
24
assert_equal "baz", I18n.t(:'foo.bar')