alexliesenfeld / httpmock

HTTP mocking library for Rust
https://httpmock.rs
MIT License
476 stars 43 forks source link

`json_body` doesn't seem to be working for YAML mocks (standalone) #118

Open mdevino opened 5 hours ago

mdevino commented 5 hours ago

Hi, I've just found the library and am trying to spin up a quick mock server. I have the following YAML, but it doesn't seem to work as expected:

when:
  method: GET
  path: /health
then:
  status: 200
  json_body: |-
    {
      "status": "healthy"
    }

When I invoke the endpoint, I do get a 200 back, but the response body is empty. Am I missing anything?

mdevino commented 5 hours ago

I've installed version 0.7.0, but httpmock --version outputs 0.6:

    Replaced package `httpmock v0.7.0` with `httpmock v0.7.0` (executable `httpmock`)
mdevino:mocks$ httpmock --version
httpmock 0.6