diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-23 10:11:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 10:11:10 -0400 |
commit | ac5f2e1162a4a04c171c4ae6209f71d14371bf30 (patch) | |
tree | b2d57ddb67df239af0ff321e6dcd3bf48bfb85a6 /vendor/github.com/onsi/gomega/matchers.go | |
parent | d36510702be1d60b8984ebcf3ad20a70f398c568 (diff) | |
parent | 1493b86c7550dbb4fabf5ea87960ee98fed58665 (diff) | |
download | podman-ac5f2e1162a4a04c171c4ae6209f71d14371bf30.tar.gz podman-ac5f2e1162a4a04c171c4ae6209f71d14371bf30.tar.bz2 podman-ac5f2e1162a4a04c171c4ae6209f71d14371bf30.zip |
Merge pull request #11310 from containers/dependabot/go_modules/github.com/onsi/gomega-1.16.0
Bump github.com/onsi/gomega from 1.15.0 to 1.16.0
Diffstat (limited to 'vendor/github.com/onsi/gomega/matchers.go')
-rw-r--r-- | vendor/github.com/onsi/gomega/matchers.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vendor/github.com/onsi/gomega/matchers.go b/vendor/github.com/onsi/gomega/matchers.go index 667160ade..223f6ef53 100644 --- a/vendor/github.com/onsi/gomega/matchers.go +++ b/vendor/github.com/onsi/gomega/matchers.go @@ -423,10 +423,29 @@ func BeADirectory() types.GomegaMatcher { //Expected must be either an int or a string. // Expect(resp).Should(HaveHTTPStatus(http.StatusOK)) // asserts that resp.StatusCode == 200 // Expect(resp).Should(HaveHTTPStatus("404 Not Found")) // asserts that resp.Status == "404 Not Found" -func HaveHTTPStatus(expected interface{}) types.GomegaMatcher { +// Expect(resp).Should(HaveHTTPStatus(http.StatusOK, http.StatusNoContent)) // asserts that resp.StatusCode == 200 || resp.StatusCode == 204 +func HaveHTTPStatus(expected ...interface{}) types.GomegaMatcher { return &matchers.HaveHTTPStatusMatcher{Expected: expected} } +// HaveHTTPHeaderWithValue succeeds if the header is found and the value matches. +// Actual must be either a *http.Response or *httptest.ResponseRecorder. +// Expected must be a string header name, followed by a header value which +// can be a string, or another matcher. +func HaveHTTPHeaderWithValue(header string, value interface{}) types.GomegaMatcher { + return &matchers.HaveHTTPHeaderWithValueMatcher{ + Header: header, + Value: value, + } +} + +// HaveHTTPBody matches if the body matches. +// Actual must be either a *http.Response or *httptest.ResponseRecorder. +// Expected must be either a string, []byte, or other matcher +func HaveHTTPBody(expected interface{}) types.GomegaMatcher { + return &matchers.HaveHTTPBodyMatcher{Expected: expected} +} + //And succeeds only if all of the given matchers succeed. //The matchers are tried in order, and will fail-fast if one doesn't succeed. // Expect("hi").To(And(HaveLen(2), Equal("hi")) |