在Rspec中,如何设置功能描述中的VCR录像模式?

In Rspec, how do I set the VCR record mode in the feature description?

我有一个像这样使用 VCR 的测试:

describe 'Do something with an api', feature: true, js: true, vcr: true do end

我想将此录像机录音设置为 new_episodes 选项(目前设置为 once),但我不知道如何将此选项传递到设置中。如何使用设置 new_episodes?

制作此功能记录

https://relishapp.com/vcr/vcr/v/2-9-3/docs/record-modes/new-episodes - 这是此选项的文档。

我可以在录像机录音中包装一个块时执行此操作,但是我想将此设置用于我的一项功能,我该怎么做?我可以在 describe 行中传递它吗?

2.9.3 非常旧(当前版本似乎是 6.1.0)。

根据文档所说,几乎显示了这个确切的示例,您可以通过 Hash

中的 :vcr 键传递该选项

spec/spec_helper.rb

VCR.configure do |c| 
  c.configure_rspec_metadata!
end

然后

spec/your_spec.rb

describe 'Do something with an api', feature: true, js: true, vcr: {record: :new_episodes} do