| 93 | } |
| 94 | |
| 95 | func TestDryRunAPI_MultipleCalls(t *testing.T) { |
| 96 | dr := NewDryRunAPI(). |
| 97 | GET("/open-apis/first").Desc("step 1"). |
| 98 | POST("/open-apis/second").Desc("step 2") |
| 99 | |
| 100 | text := dr.Format() |
| 101 | if !strings.Contains(text, "# step 1") || !strings.Contains(text, "# step 2") { |
| 102 | t.Errorf("expected both step descriptions, got: %s", text) |
| 103 | } |
| 104 | if !strings.Contains(text, "GET /open-apis/first") || !strings.Contains(text, "POST /open-apis/second") { |
| 105 | t.Errorf("expected both calls, got: %s", text) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestDryRunAPI_ExtraFieldsOnly(t *testing.T) { |
| 110 | dr := NewDryRunAPI(). |