Below is a patch against the master branch on GitHub that changes an
assert_equal into an assert_in_delta for floating point values.
Asserting that floating point values be exactly equal is usually a
futile exercise due to limitations in precision.
- Enrico
From 6f23206ac7cb13e11640fce417ebe3e5eba4357a Mon Sep 17 00:00:00 2001
From: Enrico Bianco <
enr...@gmail.com>
Date: Tue, 17 Nov 2009 11:24:25 -0500
Subject: [PATCH] RtTimeoutTest, test_damaged_restart: use
assert_in_delta instead of assert_equal for floating point values
---
test/functional/rt_5_timeout.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/functional/rt_5_timeout.rb b/test/functional/
rt_5_timeout.rb
index 5eb46aa..947d295 100644
--- a/test/functional/rt_5_timeout.rb
+++ b/test/functional/rt_5_timeout.rb
@@ -91,7 +91,7 @@ class RtTimeoutTest < Test::Unit::TestCase
assert_equal 1, @engine.processes.size
assert_equal 1, @engine.scheduler.jobs.size
- assert_equal at, @
engine.scheduler.jobs.values.first.at
+ assert_in_delta at, @
engine.scheduler.jobs.values.first.at,
1.0e-5
sleep 0.400
--
1.6.0.2