Report unexpected requests properly #5

Closed
luisobo opened this Issue Sep 5, 2012 · 1 comment

Projects

None yet

2 participants

@luisobo
Owner

If some request is made but it wasn't stubbed, Nocilla won't let that request hit the real world. In that case your test should fail.
At this moment Nocilla will return a response with a 500, the header X-Nocilla: Unexpected Request and a body with a meaningful message about the error and how to solve it, including a snippet of code on how to stub the unexpected request.

Raising an exception wasn't working well with Kiwi, it didn't report failure.

The correct way of doing this is to integrate with test runners to make the current spec fail.

@luisobo luisobo closed this Apr 25, 2013
@netbe

@luisobo is it possible to change that behavior? For example let the request execute.

That would be great to let it execute, record the response of real server, and output the all thing to an output.txt. That way you can reuse that output to stub. I have often this case when I work with a development or real test server which is a bit unstable and then you're stuck for hours until it's up again.

Is it something that is easily doable?

EDIT: just found issue #2 which is related to my comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment