Mimic,轻量级Web服务测试桩
开发语言:Ruby
注册一个Web请求测试桩:
Mimic.mimic.get("/some/path").returig("hello world")使用RestCliet访问该请求:
$ RestCliet.get("https://www.example.com:11988/some/path") # => 200 | hello world注册多个请求测试桩; 注意你可以用不同得方法为同一个url注册多个请求。
Mimic.mimic do get("/some/path").returig("Hello World", 200) get("/some/other/path").returig("Redirectig...", 301, {"Locatio" => "somewhere else"}) post("/some/path").returig("Created!", 201)ed
评论