aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_time.rb
diff options
context:
space:
mode:
authorsonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-19 04:20:48 +0000
committersonots <sonots@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-19 04:20:48 +0000
commit64231b49ca957b2a6810673e1f2abc3f63d11f29 (patch)
treef952cbf80e63596f5fe3d10e53b78c4893c0f33e /test/test_time.rb
parentb48c212ec9c72a80a2d40aa5db8df65a88c8d73c (diff)
downloadruby-64231b49ca957b2a6810673e1f2abc3f63d11f29.tar.gz
* lib/time.rb: revert r54167 because it would break
backward compatibilities, and it is documented that Time.parse does not take into account time zone abbreations other than ones described in RFC 822 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r--test/test_time.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/test/test_time.rb b/test/test_time.rb
index c7808e9cc1..0a6659f152 100644
--- a/test/test_time.rb
+++ b/test/test_time.rb
@@ -429,23 +429,6 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
assert_equal(500000, Time.parse("2000-01-01T00:00:00.5+00:00").tv_usec)
end
- def test_parse_with_zone
- t = Time.parse('2000-01-01T00:00:00 CET')
- assert_equal(2000, t.year)
- assert_equal(1, t.mon)
- assert_equal(1, t.day)
- assert_equal(0, t.hour)
- assert_equal(0, t.min)
- assert_equal(0, t.sec)
- assert_equal(3600, t.utc_offset)
- assert_equal(false, t.utc?)
-
- Time.instance_eval("ZoneOffset").each do |zone, offset|
- t = Time.parse("2000-01-01T00:00:00 #{zone}")
- assert_equal(offset*3600, t.utc_offset)
- end
- end
-
def test_strptime
assert_equal(Time.utc(2005, 8, 28, 06, 54, 20), Time.strptime("28/Aug/2005:06:54:20 +0000", "%d/%b/%Y:%T %z"))
assert_equal(Time.at(1).localtime, Time.strptime("1", "%s"))
@@ -496,21 +479,6 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc:
assert_equal(0, t.sec)
assert_equal(0, t.utc_offset)
assert_equal(true, t.utc?)
-
- t = Time.strptime('20010203 CET', '%Y%m%d %z')
- assert_equal(2001, t.year)
- assert_equal(2, t.mon)
- assert_equal(3, t.day)
- assert_equal(0, t.hour)
- assert_equal(0, t.min)
- assert_equal(0, t.sec)
- assert_equal(3600, t.utc_offset)
- assert_equal(false, t.utc?)
-
- Time.instance_eval("ZoneOffset").each do |zone, offset|
- t = Time.strptime("2000-01-01 #{zone}", '%Y-%m-%d %z')
- assert_equal(offset*3600, t.utc_offset)
- end
end
def test_nsec