我需要 VCR 跳过https://api.github.com/users/lapaty/starred调用真正的外部 API,同时继续模拟类似的路径,如https://api.github.com/repos/lgs/elasticrepo
到目前为止,我尝试了以下操作,但没有成功:
VCR.configure do |c|
...
c.ignore_hosts 'api.github.com/users/lapaty/starred'
end
和
VCR.configure do |c|
...
c.ignore_request do |request|
URI(request.uri).uri == 'https://api.github.com/users/lapaty/starred'
end
end