Permalink
Browse files

use assert_in_delta() for floating point comparisons in tests [#4871

…state:resolved]

Signed-off-by: Carl Lerche <carllerche@mac.com>
  • Loading branch information...
1 parent 07c6b7a commit 8e56085817e752bb361738ec6ca7362a3398ed77 @tenderlove tenderlove committed with Carl Lerche Jun 16, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/migration_test.rb
View
2 activerecord/test/cases/migration_test.rb
@@ -1032,7 +1032,7 @@ def test_add_table_with_decimals
elsif current_adapter?(:SQLiteAdapter)
# - SQLite3 stores a float, in violation of SQL
assert_kind_of BigDecimal, b.value_of_e
- assert_equal BigDecimal("2.71828182845905"), b.value_of_e
+ assert_in_delta BigDecimal("2.71828182845905"), b.value_of_e, 0.00000000000001
else
# - SQL standard is an integer
assert_kind_of Fixnum, b.value_of_e

0 comments on commit 8e56085

Please sign in to comment.