Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: HaveHTTPStatus multiple expected values #465

Merged
merged 3 commits into from Aug 19, 2021

Commits on Aug 17, 2021

  1. feat: formatter for HTTP responses

    Previously when the HaveHTTPStatus() matcher failed, the whole HTTP
    response object was printed out, and any message was rendered in
    bytes rather than as a string.
    
    This introduces a formatter for HTTP responses, so that the key data is
    presented in a helpful format.
    blgm committed Aug 17, 2021
    Copy the full SHA
    6796af4 View commit details
    Browse the repository at this point in the history
  2. feat: HaveHTTPStatus multiple expected values

    Sometimes more than one HTTP status is acceptable. For example a server
    may (correctly) return HTTP 204 for an empty response, or it might
    return HTTP 200 for an empty response - and we might want to accept
    either.
    
    We can now write:
    ```go
    Expect(resp).To(HaveHTTPStatus(http.StatusOK, http.StatusNoContent))
    ```
    And it will match either. This is simpler than using Or() or
    SatisfyAny().
    blgm committed Aug 17, 2021
    Copy the full SHA
    c573b36 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2021

  1. Copy the full SHA
    37b0dc5 View commit details
    Browse the repository at this point in the history