diff options
author | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-16 10:51:48 -0700 |
---|---|---|
committer | Sven Fuchs <svenfuchs@artweb-design.de> | 2008-07-16 10:51:48 -0700 |
commit | 0ac342fbe5727c22dbce58e375e9b42dd2a92ef5 (patch) | |
tree | d4869c10d770b9da1ba7dbe1b77f29d3a819abb7 | |
parent | 2e74ddbd73cb4212afbad3907f0130c6ec38572f (diff) | |
download | rails-0ac342fbe5727c22dbce58e375e9b42dd2a92ef5.tar.gz rails-0ac342fbe5727c22dbce58e375e9b42dd2a92ef5.tar.bz2 rails-0ac342fbe5727c22dbce58e375e9b42dd2a92ef5.zip |
make i18n date/time tests timezone independent
-rw-r--r-- | activesupport/test/i18n_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/activesupport/test/i18n_test.rb b/activesupport/test/i18n_test.rb index 17074b6cc6..4b17e3c523 100644 --- a/activesupport/test/i18n_test.rb +++ b/activesupport/test/i18n_test.rb @@ -9,40 +9,40 @@ class I18nTest < Test::Unit::TestCase uses_mocha 'I18nTimeZoneTest' do def test_time_zone_localization_with_default_format Time.zone.stubs(:now).returns Time.local(2000) - assert_equal "Sat, 01 Jan 2000 00:00:00 +0100", I18n.localize(Time.zone.now) + assert_equal Time.zone.now.strftime("%a, %d %b %Y %H:%M:%S %z"), I18n.localize(Time.zone.now) end end def test_date_localization_should_use_default_format - assert_equal "2008-07-02", I18n.localize(@date) + assert_equal @date.strftime("%Y-%m-%d"), I18n.localize(@date) end def test_date_localization_with_default_format - assert_equal "2008-07-02", I18n.localize(@date, :format => :default) + assert_equal @date.strftime("%Y-%m-%d"), I18n.localize(@date, :format => :default) end def test_date_localization_with_short_format - assert_equal "Jul 02", I18n.localize(@date, :format => :short) + assert_equal @date.strftime("%b %d"), I18n.localize(@date, :format => :short) end def test_date_localization_with_long_format - assert_equal "July 02, 2008", I18n.localize(@date, :format => :long) + assert_equal @date.strftime("%B %d, %Y"), I18n.localize(@date, :format => :long) end - def test_time_localization_should_use_default_format - assert_equal "Wed, 02 Jul 2008 16:47:01 +0100", I18n.localize(@time) + def test_time_localization_should_use_default_format + assert_equal @time.strftime("%a, %d %b %Y %H:%M:%S %z"), I18n.localize(@time) end def test_time_localization_with_default_format - assert_equal "Wed, 02 Jul 2008 16:47:01 +0100", I18n.localize(@time, :format => :default) + assert_equal @time.strftime("%a, %d %b %Y %H:%M:%S %z"), I18n.localize(@time, :format => :default) end def test_time_localization_with_short_format - assert_equal "02 Jul 16:47", I18n.localize(@time, :format => :short) + assert_equal @time.strftime("%d %b %H:%M"), I18n.localize(@time, :format => :short) end def test_time_localization_with_long_format - assert_equal "July 02, 2008 16:47", I18n.localize(@time, :format => :long) + assert_equal @time.strftime("%B %d, %Y %H:%M"), I18n.localize(@time, :format => :long) end def test_day_names |