aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-07-31 09:16:21 +0000
committerJamis Buck <jamis@37signals.com>2005-07-31 09:16:21 +0000
commitb4c34f7b2b18720381b3c8cfa79f66a530b3ed0b (patch)
tree51a580e8abe48f6a9f0022d0004e8494245a7fe5 /activesupport/test/core_ext/time_ext_test.rb
parenteda17194700d4cdc0d863ae8c49a8e3dbbf1615c (diff)
downloadrails-b4c34f7b2b18720381b3c8cfa79f66a530b3ed0b.tar.gz
rails-b4c34f7b2b18720381b3c8cfa79f66a530b3ed0b.tar.bz2
rails-b4c34f7b2b18720381b3c8cfa79f66a530b3ed0b.zip
Fixed that Time#midnight would have a non-zero usec on some platforms #1836
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index 6be1a70f94..dca810d67e 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -130,4 +130,11 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
def test_to_time
assert_equal Time.local(2005, 2, 21, 17, 44, 30), Time.local(2005, 2, 21, 17, 44, 30).to_time
end
-end \ No newline at end of file
+
+ # NOTE: this test seems to fail (changeset 1958) only on certain platforms,
+ # like OSX, and FreeBSD 5.4.
+ def test_fp_inaccuracy_ticket_1836
+ midnight = Time.local(2005, 2, 21, 0, 0, 0)
+ assert_equal midnight.midnight, (midnight + 1.hour + 0.000001).midnight
+ end
+end