0
我有一個問題,當規範測試CSV.open與fakefs並引發引發ArgumentError:錯誤的參數數目(3 2)FakeFS和CSV.open規範測試引發引發ArgumentError:錯誤的參數數目(3 2)
規範的代碼如下:
紅寶石版本是1.7.1的JRuby(1.9.3p327)
fakefs版本是0.4.2
需要 'fakefs /安全'
it 'should pull offers and save them into file' do
FakeFS do
extractor.process(affiliate_ids)
File::size(FILE_NAME).should > 0
end
end
紅寶石代碼如下:
class Extractor
def process(affiliates)
save(ds)
end
# saves all the buy URLs to a text file
def save(ds)
@@logger.info "Writing offers to file #{FILE_NAME}"
CSV.open(FILE_NAME, "w") do |csv|
ds.each do |row|
buy_url = row[:buy_url]
csv << [row[:name], row[:offer_id], buy_url]
end
end
end
end
任何人都知道是什麼原因導致這個問題? 在此先感謝
吳大維