summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_time.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index d6ce30498f..03172149ea 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -14,6 +14,11 @@ class TestTime < Test::Unit::TestCase
$VERBOSE = @verbose
end
+ def no_leap_seconds?
+ # 1972-06-30T23:59:60Z is the first leap second.
+ Time.utc(1972, 7, 1, 0, 0, 0) - Time.utc(1972, 6, 30, 23, 59, 59) == 1
+ end
+
def get_t2000
if no_leap_seconds?
# Sat Jan 01 00:00:00 UTC 2000