xetorthio / shmock

Simple HTTP Mocking Library
MIT License
101 stars 20 forks source link

Request forwarding to wait callback #10

Open emidiocroci opened 10 years ago

emidiocroci commented 10 years ago

I used shmock to mock requests to a legacy library during some integration tests and I needed to inspect the received request in order to get the value of some parameters contained in the body, so I decided to forward it in the wait callback. I should be useful for an advanced inspection of the received request.

tinchogob commented 10 years ago

Maybe I'm misunderstanding you, but can't you do it with .send()

https://github.com/xetorthio/shmock#on-request-body

emidiocroci commented 10 years ago

From what I understood, .send() is used to tell shmock what parameters it should expect in the request but I need to know what are the received parameters (not if they are equal to something else). More precisely, I was mocking an authentication request and I needed to know what was the username sent to the library.