Hey team, I was wondering what the purpose of the ...
# pact-ruby
j
Hey team, I was wondering what the purpose of the assertion in the consumer spec if we're mocking the provider service. Example: https://github.com/pact-foundation/pact-ruby/blob/master/example/zoo-app/spec/service_providers/animal_service_client_spec.rb#L28
b
@Jason Wang the consumer side of a pact spec checks 2 things. 1, that the consumer code sends the expected request and 2. That it does the right thing with the response.
Eg does it parse the body correctly and return a domain object. Should it raise an exception if it gets a 500. Should it return null for a 404.
To check these, you should use your normal testing framework expectations.
It's just like a normal unit test for the client.
j
I see, that makes sense. Thanks @Beth (pactflow.io/Pact Broker/pact-ruby)
👍🏼 1