~ubuntu-branches/ubuntu/utopic/ruby-i18n/utopic-proposed

« back to all changes in this revision

Viewing changes to .pc/0001-Skip-test-that-fails-on-1.9.patch/test/i18n/load_path_test.rb

  • Committer: Package Import Robot
  • Author(s): Antonio Terceiro, Lucas Nussbaum, Antonio Terceiro
  • Date: 2011-11-04 12:36:39 UTC
  • Revision ID: package-import@ubuntu.com-20111104123639-jouzm72kvrhngroz
Tags: 0.6.0-1
[ Lucas Nussbaum ]
* Switch to gem2deb-based packaging. Rename source and binary package.

[ Antonio Terceiro ]
* New upstream release: 0.6.0
* Updated Standards-Version to 3.9.2 No changes neeed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'test_helper'
 
2
 
 
3
class I18nLoadPathTest < Test::Unit::TestCase
 
4
  def setup
 
5
    I18n.locale = :en
 
6
    I18n.backend = I18n::Backend::Simple.new
 
7
    store_translations(:en, :foo => {:bar => 'bar', :baz => 'baz'})
 
8
  end
 
9
 
 
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')
 
13
  end
 
14
 
 
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")
 
19
    end
 
20
  end
 
21
 
 
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')
 
25
  end
 
26
end