我的测试有问题。
我有这个规格:
context 'when no section is supplied' do
it 'raises an ArgumentError regarding the missing section_id argument' do
expect do
described_class.with_section
end.to raise_error(ArgumentError)
.with_message /wrong number of arguments \(given 0\, expected 1\)/
end
end
在某些环境中,消息是:
ArgumentError: wrong number of arguments (0 for 1)
在其他环境中,消息是:
ArgumentError: wrong number of arguments (given 0, expected 1)
所以我有一个测试通过我的 Mac 并在另一台计算机上失败。
我怎样才能解决这个问题?