I currently have a project in Ruby on Rails with Ruby 1.8.7 and Rails 2.3.2
I have some unit tests that read data from a database, in particular, a time column for two consecutive elements that should be 24 hours apart. In one test, I set the date-time for item 2 equal to the value of item 1.
When I make a statement to make sure that both values ββare equal, the test works fine under rails 2.3.2. When I upgrade to rails 2.3.11, the tests do not show that the difference between the two points is turned off with the following error:
<Thu, 01 Jan 2009 06:00:00 CST -06:00> expected but was <Thu, 01 Jan 2009 05:59:59 CST -06:00>.
There seems to be a problem with floating point conversions in two versions of rails. How can I take into account the floating point problem?
ruby ruby-on-rails
Daven patel
source share