~ubuntu-branches/ubuntu/vivid/ruby-i18n/vivid

« back to all changes in this revision

Viewing changes to test/gettext/backend_test.rb

  • Committer: Package Import Robot
  • Author(s): Praveen Arimbrathodiyil
  • Date: 2013-06-03 19:20:31 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20130603192031-qk11as87x3cotd1n
Tags: upstream-0.6.1
Import upstream version 0.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
      I18n.locale = :de
44
44
      assert_equal 'Räderzahl', sgettext('Car|Wheels count')
45
45
      assert_equal 'Räderzahl', pgettext('Car', 'Wheels count')
 
46
      assert_equal 'Räderzahl!', pgettext('New car', 'Wheels count')
46
47
    end
47
48
 
48
49
    def test_uses_namespaced_default_translation
49
50
      assert_equal 'Wheels count', sgettext('Car|Wheels count')
50
51
      assert_equal 'Wheels count', pgettext('Car', 'Wheels count')
 
52
      assert_equal 'Wheels count', pgettext('New car', 'Wheels count')
51
53
    end
52
54
 
53
55
    def test_pluralizes_entry
67
69
      assert_equal 'Räder', nsgettext('Car|wheel', 'wheels', 2)
68
70
      assert_equal 'Rad',   npgettext('Car', 'wheel', 'wheels', 1)
69
71
      assert_equal 'Räder', npgettext('Car', 'wheel', 'wheels', 2)
 
72
      assert_equal 'Rad!', npgettext('New car', 'wheel', 'wheels', 1)
 
73
      assert_equal 'Räder!', npgettext('New car', 'wheel', 'wheels', 2)
70
74
    end
71
75
 
72
76
    def test_pluralizes_namespaced_default_entry
74
78
      assert_equal 'wheels', nsgettext('Car|wheel', 'wheels', 2)
75
79
      assert_equal 'wheel',  npgettext('Car', 'wheel', 'wheels', 1)
76
80
      assert_equal 'wheels', npgettext('Car', 'wheel', 'wheels', 2)
 
81
      assert_equal 'wheel', npgettext('New car', 'wheel', 'wheels', 1)
 
82
      assert_equal 'wheels', npgettext('New car', 'wheel', 'wheels', 2)
77
83
    end
78
84
 
79
85
    def test_pluralizes_namespaced_entry_with_alternative_syntax
82
88
      assert_equal 'Räder', nsgettext(['Car|wheel', 'wheels'], 2)
83
89
      assert_equal 'Rad',   npgettext('Car', ['wheel', 'wheels'], 1)
84
90
      assert_equal 'Räder', npgettext('Car', ['wheel', 'wheels'], 2)
 
91
      assert_equal 'Rad!', npgettext('New car', ['wheel', 'wheels'], 1)
 
92
      assert_equal 'Räder!', npgettext('New car', ['wheel', 'wheels'], 2)
85
93
    end
86
94
 
87
95
    def test_ngettextpluralizes_entry_with_dots