Skip to content

Commit

Permalink
use assert_in_delta() for floating point comparisons in tests [#4871
Browse files Browse the repository at this point in the history
…state:resolved]

Signed-off-by: Carl Lerche <carllerche@mac.com>
  • Loading branch information
tenderlove authored and Carl Lerche committed Jun 16, 2010
1 parent 07c6b7a commit 8e56085
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/test/cases/migration_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8e56085

Please sign in to comment.