mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use assert_in_delta() for floating point comparisons in tests [#4871 state:resolved]
Signed-off-by: Carl Lerche <carllerche@mac.com>
This commit is contained in:
parent
07c6b7a6ad
commit
8e56085817
1 changed files with 1 additions and 1 deletions
|
@ -1032,7 +1032,7 @@ if ActiveRecord::Base.connection.supports_migrations?
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue