是否有一种标准方法可以使故障输出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">.
理想情况下,输出应该是对齐的,并且可能会被修剪以显示它们实际不同的地方。当前输出对于小字符串来说很好,但是当字符串很长时很难辨别它们的不同之处。