如何使用 webmock 正则表达式匹配器? [英] How to use webmock regex matcher?
本文介绍了如何使用 webmock 正则表达式匹配器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何匹配 URL,如:
How to match a URL like:
http://www.example.com/foo/:id/bar
http://www.example.com/foo/1/bar
http://www.example.com/foo/999/bar
stub_request(:post, "www.example.com")
stub_request(:post, "www.example.com")
推荐答案
http://www\..*?\.com/foo/\d+/bar
应该适合你.
这篇关于如何使用 webmock 正则表达式匹配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文