aboutsummaryrefslogtreecommitdiffstats
path: root/lib/time.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-17 13:13:42 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-17 13:13:42 +0000
commitf9c2dcec4eec842a3d35d83644fed4cc892d94dc (patch)
treebf02be522b862110d52b61cf3f90b21bae8d9b57 /lib/time.rb
parent0a3a46b45ec316860a30640552d77ae0db864fee (diff)
downloadruby-f9c2dcec4eec842a3d35d83644fed4cc892d94dc.tar.gz
check ArgumentError by Time.at(-1) instead of by test itself.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/time.rb')
-rw-r--r--lib/time.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/time.rb b/lib/time.rb
index db8728402e..6ee32ba3bf 100644
--- a/lib/time.rb
+++ b/lib/time.rb
@@ -400,6 +400,9 @@ if __FILE__ == $0
Time.rfc2822("Mon, 24 Nov 1997 14:22:01 -0800"))
begin
Time.at(-1)
+ rescue ArgumentError
+ # ignore
+ else
assert_equal(Time.utc(1969, 2, 13, 23, 32, 54) + 3 * 3600 + 30 * 60,
Time.rfc2822("Thu, 13 Feb 1969 23:32:54 -0330"))
assert_equal(Time.utc(1969, 2, 13, 23, 32, 0) + 3 * 3600 + 30 * 60,
@@ -409,7 +412,6 @@ if __FILE__ == $0
1969
23:32
-0330 (Newfoundland Time)"))
- rescue ArgumentError
end
assert_equal(Time.utc(1997, 11, 21, 9, 55, 6),
Time.rfc2822("21 Nov 97 09:55:06 GMT"))
@@ -464,10 +466,13 @@ if __FILE__ == $0
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))
- rescue ArgumentError
end
end
@@ -523,9 +528,12 @@ if __FILE__ == $0
assert_equal("2001-04-17T19:23:17.1Z", t.xmlschema(1))
begin
+ Time.at(-1)
+ rescue ArgumentError
+ # ignore
+ else
t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
- rescue ArgumentError
end
end