aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-03-10 23:57:11 +0200
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-03-10 23:57:11 +0200
commit20ae0d0e39b9e0da67424c6b941fcdeed90d8d55 (patch)
tree532868bd1eaf1757219ca75aa36232ed09c8cb55 /activesupport
parent5522fd9bd8a1efd79cb2f48c712fa95092c15907 (diff)
downloadrails-20ae0d0e39b9e0da67424c6b941fcdeed90d8d55.tar.gz
rails-20ae0d0e39b9e0da67424c6b941fcdeed90d8d55.tar.bz2
rails-20ae0d0e39b9e0da67424c6b941fcdeed90d8d55.zip
Fixed tests for returning an instance of `Time` in the local system timezone.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index bff155f045..62c5741ffb 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -293,16 +293,16 @@ end
class StringConversionsTest < ActiveSupport::TestCase
def test_string_to_time
- with_env_tz "US/Eastern" do
+ with_env_tz "Europe/Moscow" do
assert_equal Time.utc(2005, 2, 27, 23, 50), "2005-02-27 23:50".to_time(:utc)
assert_equal Time.local(2005, 2, 27, 23, 50), "2005-02-27 23:50".to_time
assert_equal Time.utc(2005, 2, 27, 23, 50, 19, 275038), "2005-02-27T23:50:19.275038".to_time(:utc)
assert_equal Time.local(2005, 2, 27, 23, 50, 19, 275038), "2005-02-27T23:50:19.275038".to_time
assert_equal Time.utc(2039, 2, 27, 23, 50), "2039-02-27 23:50".to_time(:utc)
assert_equal Time.local(2039, 2, 27, 23, 50), "2039-02-27 23:50".to_time
- assert_equal Time.local(2011, 2, 27, 18, 50), "2011-02-27 22:50 -0100".to_time
+ assert_equal Time.local(2011, 2, 27, 18, 50), "2011-02-27 13:50 -0100".to_time
assert_equal Time.utc(2011, 2, 27, 23, 50), "2011-02-27 22:50 -0100".to_time(:utc)
- assert_equal Time.local(2005, 2, 27, 23, 50), "2005-02-27 23:50 -0500".to_time
+ assert_equal Time.local(2005, 2, 27, 23, 50), "2005-02-27 14:50 -0500".to_time
assert_nil "".to_time
end
end
@@ -317,11 +317,11 @@ class StringConversionsTest < ActiveSupport::TestCase
end
def test_partial_string_to_time
- with_env_tz "US/Eastern" do
+ with_env_tz "Europe/Moscow" do
now = Time.now
assert_equal Time.local(now.year, now.month, now.day, 23, 50), "23:50".to_time
assert_equal Time.utc(now.year, now.month, now.day, 23, 50), "23:50".to_time(:utc)
- assert_equal Time.local(now.year, now.month, now.day, 18, 50), "22:50 -0100".to_time
+ assert_equal Time.local(now.year, now.month, now.day, 18, 50), "13:50 -0100".to_time
assert_equal Time.utc(now.year, now.month, now.day, 23, 50), "22:50 -0100".to_time(:utc)
end
end