describe Rspec do
it 'should print arrays in a readable manner' do
arr = [
[0, :a, -1],
[1, :b, -2],
[2, :c, -3],
[3, :d, -4],
[4, :e, -5],
[6, :g, -7],
[7, :h, -8],
[8, :i, -9]
]
arr.should eql []
end
end
失败时:
Failures:
1) Rspec should print arrays in a readable manner
Failure/Error: arr.should eql []
expected: []
got: [[0, :a, -1], [1, :b, -2], [2, :c, -3], [3, :d, -4], [4, :e, -5], [6, :g, -7], [7, :h, -8], [8, :i, -9]]
有没有办法告诉 Rspec 漂亮地打印它的失败?我的真实示例可以在数组中包含 10 到 40 个元素,每个元素是一个由 5 个整数和一个字符串组成的数组。