在RSPEC中,如何在功能描述中设置VCR记录模式?
我有一个使用这样的VCR的测试:
描述'用API做某事',功能:true,js:true,vcr:true do
end
我想将此VCR录制设置为选项new_episodes
(当前设置为ANCE
),但我无法找到如何通过此选项进入设置。如何使用设置new_episodes
制作此功能记录?
https://relishapp.com/ vcr/vcr/v/2-9-3/doc/record-modes/new-episodes - 这是此选项的文档。
当在VCR录制中包装块时,我可以做到这一点,但是我想将此设置用于我的一个功能,我该怎么做?我可以在Dricesd
行上传递它吗?
I have a test that uses VCR like this:
describe 'Do something with an api', feature: true, js: true, vcr: true do
end
I want to set this vcr recording to the option new_episodes
(it's currently set to once
) but I can't find out how to pass this option into the settings. How to I make this feature record with the setting new_episodes
?
https://relishapp.com/vcr/vcr/v/2-9-3/docs/record-modes/new-episodes - here's the docs for this option.
I can do it when wrapping a block in a vcr recording, however I want to use this setting for one of my features, how do I go about doing that? Can I pass it in on the describe
line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
2.9.3非常旧(当前版本似乎是6.1.0)。
话虽这么说,根据文档,几乎显示了这个确切的示例,您可以通过
:vcr
键传递该选项。
然后
spec/your_spec.rb
2.9.3 is extremely old (current version appears to be 6.1.0).
That being said according to the docs, which show almost this exact example, you can pass that option through the
:vcr
key in theHash
spec/spec_helper.rb
And then
spec/your_spec.rb