Class: I18nExceptionsTest
- Defined in:
- lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb
Instance Method Summary collapse
- #test_invalid_locale_message ⇒ Object
- #test_invalid_locale_stores_locale ⇒ Object
- #test_invalid_pluralization_data_message ⇒ Object
- #test_invalid_pluralization_data_stores_entry_and_count ⇒ Object
- #test_missing_interpolation_argument_message ⇒ Object
- #test_missing_interpolation_argument_stores_key_and_string ⇒ Object
- #test_missing_translation_data_message ⇒ Object
- #test_missing_translation_data_stores_locale_key_and_options ⇒ Object
- #test_reserved_interpolation_key_message ⇒ Object
- #test_reserved_interpolation_key_stores_key_and_string ⇒ Object
Instance Method Details
#test_invalid_locale_message ⇒ Object
15 16 17 18 19 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 15 def force_invalid_locale rescue I18n::ArgumentError => e assert_equal 'nil is not a valid locale', e. end |
#test_invalid_locale_stores_locale ⇒ Object
9 10 11 12 13 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 9 def test_invalid_locale_stores_locale force_invalid_locale rescue I18n::ArgumentError => e assert_nil e.locale end |
#test_invalid_pluralization_data_message ⇒ Object
43 44 45 46 47 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 43 def force_invalid_pluralization_data rescue I18n::ArgumentError => e assert_equal 'translation data [:bar] can not be used with :count => 1', e. end |
#test_invalid_pluralization_data_stores_entry_and_count ⇒ Object
36 37 38 39 40 41 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 36 def test_invalid_pluralization_data_stores_entry_and_count force_invalid_pluralization_data rescue I18n::ArgumentError => e assert_equal [:bar], e.entry assert_equal 1, e.count end |
#test_missing_interpolation_argument_message ⇒ Object
56 57 58 59 60 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 56 def force_missing_interpolation_argument rescue I18n::ArgumentError => e assert_equal 'interpolation argument bar missing in "{{bar}}"', e. end |
#test_missing_interpolation_argument_stores_key_and_string ⇒ Object
49 50 51 52 53 54 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 49 def test_missing_interpolation_argument_stores_key_and_string force_missing_interpolation_argument rescue I18n::ArgumentError => e assert_equal 'bar', e.key assert_equal "{{bar}}", e.string end |
#test_missing_translation_data_message ⇒ Object
30 31 32 33 34 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 30 def force_missing_translation_data rescue I18n::ArgumentError => e assert_equal 'translation missing: de, bar, foo', e. end |
#test_missing_translation_data_stores_locale_key_and_options ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 21 def force_missing_translation_data rescue I18n::ArgumentError => e = {:scope => :bar} assert_equal 'de', e.locale assert_equal :foo, e.key assert_equal , e. end |
#test_reserved_interpolation_key_message ⇒ Object
69 70 71 72 73 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 69 def force_reserved_interpolation_key rescue I18n::ArgumentError => e assert_equal 'reserved key "scope" used in "{{scope}}"', e. end |
#test_reserved_interpolation_key_stores_key_and_string ⇒ Object
62 63 64 65 66 67 |
# File 'lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb', line 62 def test_reserved_interpolation_key_stores_key_and_string force_reserved_interpolation_key rescue I18n::ArgumentError => e assert_equal 'scope', e.key assert_equal "{{scope}}", e.string end |