namshi/mockserver — pull request #10 by OverZealous (2014-11-11 04:13:28+00:00)
Title: Added the ability to include custom headers in the filename

This PR includes the ability to specify custom headers that should be part of the filename. For example, you could ask mockserver to include the `Authorization` header, so you can "login" as different users and see different results, like so:

```
var mockserver = require('mockserver');
mockserver.headers = ['Authorization'];
// user mockserver like normal
```
Now, you can have files like this:

```
secure/GET.mock -> 401 NOT AUTHORIZED
login/POST.mock -> returns an auth token for client to store
secure/GET_Authorization=TOKEN.mock -> 200 OK
```

PR includes updated docs and tests, as well.

I also took the liberty to rewrite the tests to use a single function to set up and run the mock tests, to make it easier to focus on the differences. :smile: