提交 a363099c 编写于 作者: A Akira Matsuda

Add assertion messages

This message could be generated by `assert_predicate`, https://github.com/rails/rails/commit/1853a4f2c8b2bddfbde6aae80abb08310295201c#commitcomment-20546113
but I'd rather handwrite the message string if I could reduce magic from the code by doing so.
上级 c5ec3272
......@@ -30,7 +30,7 @@ class PostgresqlInfinity < ActiveRecord::Base
record = PostgresqlInfinity.new(float: "-Infinity")
assert_equal(-Float::INFINITY, record.float)
record = PostgresqlInfinity.new(float: "NaN")
assert record.float.nan?
assert record.float.nan?, "Expected #{record.float} to be NaN"
end
test "update_all with infinity on a float column" do
......
......@@ -31,7 +31,7 @@ def test_values
assert_equal 123456.789, first.double
assert_equal(-::Float::INFINITY, second.single)
assert_equal ::Float::INFINITY, second.double
assert third.double.nan?
assert third.double.nan?, "Expected #{third.double} to be NaN"
end
def test_update
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册