是否有一种标准方法可以使assert_equal
的失败输出更具可读性?
test "compare" do
assert_equal "some string", "some string that differs"
end
这会产生:
MiniTest::Assertion: <"some string"> expected but was
<"some string that differs">.
理想情况下,输出会对齐,也可能会修剪以显示它们实际上的差异。对于小字符串,当前输出很好,但是当字符串很长时,很难辨别它们的不同之处。