basicallydan/interfake — pull request #12 by rajit (2014-03-28 16:28:12+00:00)
Title: Add support for handling query params

We wanted to use interfake to be able to handle requests like:

```
GET /something?query=12
```

But of course it was failing to register this correctly. This pull request adds support for query parameters by allowing you to call createRoute as follows:

```js
interfake.createRoute({
request: {
url: '/something',
query: {
query: 12
},
method: 'get'
},
response: {
status: 200,
body: { response: 'body' }
}
});
```

Commit message:
Added createRouteHash() to maintain canonical form of a request.
Use lookup table to store expected responses, with route-hash as key.
Add tests to confirm query params work.
All tests pass, with modifications.
Added afterEach() to ensure interfake.stop() is called after each test, even if the test fails.