我想检查Pandoc.convert
是用这样的选项调用的to: :docx
:
options = {to: :docx}
PandocRuby.convert("some string", options)
我在规范中有以下期望:
expect(PandocRuby).to receive(:convert).with(hash_including(to: :docx))
规范失败如下:
Failure/Error: expect(PandocRuby).to receive(:convert).with(hash_including(to: :docx))
(PandocRuby (class)).convert(hash_including(:to=>:docx))
expected: 1 time with arguments: (hash_including(:to=>:docx))
received: 0 times
但是调试的时候options
是这样的:
[2] pry(#<ReportDocumentsController>)> options
=> {
:to => :docx,
:reference_docx => "/Users/josh/Documents/Work/Access4All/Projects/a4aa2/src/public/uploads/report_template/reference_docx/1/reference.docx"
}
我想我使用了错误的 RSpec 匹配器(或以错误的方式使用正确的匹配器),但我无法让它工作。