Class: I18nSimpleBackendPluralizeTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- I18nSimpleBackendPluralizeTest
show all
- Includes:
- I18nSimpleBackendTestSetup
- Defined in:
- lib/vendor/i18n/test/simple_backend_test.rb
Instance Method Summary
collapse
#add_datetime_translations, #backend_get_translations, #setup_backend
Instance Method Details
#test_interpolate_given_incomplete_pluralization_data_raises_invalid_pluralization_data ⇒ Object
232
233
234
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 232
def test_interpolate_given_incomplete_pluralization_data_raises_invalid_pluralization_data
assert_raises(I18n::InvalidPluralizationData){ @backend.send(:pluralize, nil, {:one => 'bar'}, 2) }
end
|
#test_pluralize_given_0_returns_plural_string_if_no_zero_key_given ⇒ Object
216
217
218
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 216
def test_pluralize_given_0_returns_plural_string_if_no_zero_key_given
assert_equal 'bars', @backend.send(:pluralize, nil, {:one => 'bar', :other => 'bars'}, 0)
end
|
#test_pluralize_given_0_returns_zero_string_if_zero_key_given ⇒ Object
212
213
214
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 212
def test_pluralize_given_0_returns_zero_string_if_zero_key_given
assert_equal 'zero', @backend.send(:pluralize, nil, {:zero => 'zero', :one => 'bar', :other => 'bars'}, 0)
end
|
#test_pluralize_given_1_returns_singular_string ⇒ Object
220
221
222
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 220
def test_pluralize_given_1_returns_singular_string
assert_equal 'bar', @backend.send(:pluralize, nil, {:one => 'bar', :other => 'bars'}, 1)
end
|
#test_pluralize_given_2_returns_plural_string ⇒ Object
224
225
226
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 224
def test_pluralize_given_2_returns_plural_string
assert_equal 'bars', @backend.send(:pluralize, nil, {:one => 'bar', :other => 'bars'}, 2)
end
|
#test_pluralize_given_3_returns_plural_string ⇒ Object
228
229
230
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 228
def test_pluralize_given_3_returns_plural_string
assert_equal 'bars', @backend.send(:pluralize, nil, {:one => 'bar', :other => 'bars'}, 3)
end
|
#test_pluralize_given_nil_returns_the_given_entry ⇒ Object
207
208
209
210
|
# File 'lib/vendor/i18n/test/simple_backend_test.rb', line 207
def test_pluralize_given_nil_returns_the_given_entry
entry = {:one => 'bar', :other => 'bars'}
assert_equal entry, @backend.send(:pluralize, nil, entry, nil)
end
|