提交 4d209b5d 编写于 作者: R Rafael Mendonça França

Merge pull request #15610 from sgrif/silence-warnings

Fix warnings in tests
......@@ -156,7 +156,7 @@ def test_custom_range_values
assert_equal 0.5..0.7, @first_range.float_range
assert_equal 0.5...0.7, @second_range.float_range
assert_equal 0.5...Float::INFINITY, @third_range.float_range
assert_equal (-Float::INFINITY...Float::INFINITY), @fourth_range.float_range
assert_equal(-Float::INFINITY...Float::INFINITY, @fourth_range.float_range)
assert_nil @empty_range.float_range
end
......
......@@ -34,10 +34,10 @@ def test_find
end
def test_find_with_proc_parameter_and_block
e = assert_raises(RuntimeError) do
exception = assert_raises(RuntimeError) do
Topic.all.find(-> { raise "should happen" }) { |e| e.title == "non-existing-title" }
end
assert_equal "should happen", e.message
assert_equal "should happen", exception.message
assert_nothing_raised(RuntimeError) do
Topic.all.find(-> { raise "should not happen" }) { |e| e.title == topics(:first).title }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册