Skip to content

Commit

Permalink
Fix info in failing web body tests
Browse files Browse the repository at this point in the history
  • Loading branch information
themue committed Nov 14, 2021
1 parent 3d75fbd commit 32c05d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions environments/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ func (wresp *WebResponse) AssertUnmarshalledBody(data interface{}) {
func (wresp *WebResponse) AssertBodyMatches(pattern string) {
restore := wresp.wa.assert.IncrCallstackOffset()
defer restore()
ok, err := regexp.MatchString(pattern, string(wresp.body))
body := string(wresp.body)
ok, err := regexp.MatchString(pattern, body)
wresp.wa.assert.Nil(err, "illegal content match pattern")
wresp.wa.assert.True(ok, "body doesn't match pattern")
wresp.wa.assert.True(ok, "body doesn't match pattern", body)
}

// AssertBodyGrep greps content out of the body.
Expand Down

0 comments on commit 32c05d9

Please sign in to comment.