github.com/goplus/yap@v0.8.1/ytest/demo/match/diveinto/hello_yapt.gox (about)

     1  mock "foo.com", new(AppV2)
     2  
     3  id := "123"
     4  get "http://foo.com/p/${id}"
     5  
     6  send                 // send request
     7  match 200, resp.code // assert resp.code == 200
     8  match "application/json", resp.header.get("Content-Type")
     9  match {              // assert resp.body.id == id
    10  	"id": id,
    11  }, resp.body
    12  
    13  echo "OK"