Module: Tests::Backend::Api::Localization::Time
- Included in:
- I18nChainBackendApiLocalizeTimeTest, I18nFallbacksBackendApiLocalizeTimeTest, I18nPluralizationBackendApiLocalizeTimeTest, I18nSimpleBackendApiLocalizeTimeTest
- Defined in:
- lib/vendor/i18n/test/api/localization/time.rb
Instance Method Summary collapse
-
#test_localize_given_a_day_name_format_it_returns_the_correct_day_name ⇒ Object
TODO Seems to break on Windows because ENV is ignored.
- #test_localize_given_a_format_specified_as_a_proc ⇒ Object
- #test_localize_given_a_format_specified_as_a_proc_with_additional_options ⇒ Object
- #test_localize_given_a_meridian_indicator_format_it_returns_the_correct_meridian_indicator ⇒ Object
- #test_localize_given_a_month_name_format_it_returns_the_correct_month_name ⇒ Object
- #test_localize_given_an_abbr_day_name_format_it_returns_the_correct_abbrevated_day_name ⇒ Object
-
#test_localize_given_an_abbr_month_name_format_it_returns_the_correct_abbrevated_month_name ⇒ Object
TODO should be Mrz, shouldn’t it?.
- #test_localize_given_an_unknown_format_it_does_not_fail ⇒ Object
- #test_localize_given_no_format_it_does_not_fail ⇒ Object
- #test_localize_given_the_long_format_it_uses_it ⇒ Object
-
#test_localize_given_the_short_format_it_uses_it ⇒ Object
TODO should be Mrz, shouldn’t it?.
Instance Method Details
#test_localize_given_a_day_name_format_it_returns_the_correct_day_name ⇒ Object
22 23 24 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 22 def test_localize_given_a_day_name_format_it_returns_the_correct_day_name assert_equal 'Samstag', I18n.backend.localize('de', morning_time, '%A') end |
#test_localize_given_a_format_specified_as_a_proc ⇒ Object
44 45 46 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 44 def test_localize_given_a_format_specified_as_a_proc assert_equal '1ter März 2008, 06:00 Uhr', I18n.backend.localize('de', morning_time, :long_ordinalized) end |
#test_localize_given_a_format_specified_as_a_proc_with_additional_options ⇒ Object
48 49 50 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 48 def assert_equal '1ter März 2008, 06:00 Uhr (MEZ)', I18n.backend.localize('de', morning_time, :long_ordinalized, :timezone => 'MEZ') end |
#test_localize_given_a_meridian_indicator_format_it_returns_the_correct_meridian_indicator ⇒ Object
39 40 41 42 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 39 def test_localize_given_a_meridian_indicator_format_it_returns_the_correct_meridian_indicator assert_equal 'am', I18n.backend.localize('de', morning_time, '%p') assert_equal 'pm', I18n.backend.localize('de', evening_time, '%p') end |
#test_localize_given_a_month_name_format_it_returns_the_correct_month_name ⇒ Object
30 31 32 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 30 def test_localize_given_a_month_name_format_it_returns_the_correct_month_name assert_equal 'März', I18n.backend.localize('de', morning_time, '%B') end |
#test_localize_given_an_abbr_day_name_format_it_returns_the_correct_abbrevated_day_name ⇒ Object
26 27 28 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 26 def test_localize_given_an_abbr_day_name_format_it_returns_the_correct_abbrevated_day_name assert_equal 'Sa', I18n.backend.localize('de', morning_time, '%a') end |
#test_localize_given_an_abbr_month_name_format_it_returns_the_correct_abbrevated_month_name ⇒ Object
TODO should be Mrz, shouldn’t it?
35 36 37 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 35 def test_localize_given_an_abbr_month_name_format_it_returns_the_correct_abbrevated_month_name assert_equal 'Mar', I18n.backend.localize('de', morning_time, '%b') end |
#test_localize_given_an_unknown_format_it_does_not_fail ⇒ Object
56 57 58 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 56 def test_localize_given_an_unknown_format_it_does_not_fail assert_nothing_raised{ I18n.backend.localize 'de', morning_time, '%x' } end |
#test_localize_given_no_format_it_does_not_fail ⇒ Object
52 53 54 |
# File 'lib/vendor/i18n/test/api/localization/time.rb', line 52 def test_localize_given_no_format_it_does_not_fail assert_nothing_raised{ I18n.backend.localize 'de', morning_time } end |