method
test_rfc3339

v1_9_1_378 -
Show latest stable
-
0 notes -
Class: TimeExtentionTest
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378 (0)
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
test_rfc3339()
public
Hide source
# File lib/time.rb, line 577 def test_rfc3339 t = Time.utc(1985, 4, 12, 23, 20, 50, 520000) s = "1985-04-12T23:20:50.52Z" assert_equal(t, Time.iso8601(s)) assert_equal(s, t.iso8601(2)) t = Time.utc(1996, 12, 20, 0, 39, 57) s = "1996-12-19T16:39:57-08:00" assert_equal(t, Time.iso8601(s)) # There is no way to generate time string with arbitrary timezone. s = "1996-12-20T00:39:57Z" assert_equal(t, Time.iso8601(s)) assert_equal(s, t.iso8601) t = Time.utc(1990, 12, 31, 23, 59, 60) s = "1990-12-31T23:59:60Z" assert_equal(t, Time.iso8601(s)) # leap second is representable only if timezone file has it. s = "1990-12-31T15:59:60-08:00" assert_equal(t, Time.iso8601(s)) begin Time.at(-1) rescue ArgumentError # ignore else t = Time.utc(1937, 1, 1, 11, 40, 27, 870000) s = "1937-01-01T12:00:27.87+00:20" assert_equal(t, Time.iso8601(s)) end end