我的測試中有一個問題。在某些環境中,「參數數量錯誤」RSpec測試失敗
我有這個天賦:
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並在另一臺計算機上失敗。
我該如何解決這個問題?