hibri / HttpMock

A library for creating Http servers on the fly in tests and stubbing responses
MIT License
128 stars 44 forks source link

Add ability to set request content dynamically #36

Closed mattolenik closed 8 years ago

mattolenik commented 8 years ago

.Return() can now take a Func, and will lazily retrieve the data from this function. This allows one to easily return different results for the same stub on the fly.

knocte commented 8 years ago

Thanks for your contribution. You're using different whitespace format as the original project, can you please fix your style to go in sync with the current standard? Thanks

hibri commented 8 years ago

Hi @mattolenik Thanks for this :) As @knocte mentioned, could you fix the white space and update the PR please ? I'll merge and publish a new package after.

mattolenik commented 8 years ago

What's the exact style I should use? I saw mixed styles in various parts of the code. I do see some tabbing issues which were hidden in my IDE, I'll be sure to get those.

knocte commented 8 years ago

I thought it was obvious. Just look at the diff and you will see that tabs are used for indentation in all files you have modified. But your changes use spaces or spaces+1tab.

mattolenik commented 8 years ago

Sorry, I thought you were referring to both brace styling and whitespace. I see the whitespace issues, I'll fix those shortly. I saw multiple styles of bracing and was confused if you were referring to that.

mattolenik commented 8 years ago

Should be all fixed up. I just tabified any file I was making changes to.

knocte commented 8 years ago

Can you rebase your changes to squash all commits into one? Should be easy to do by doing git rebase HEAD~3 -i and then replacing "pick" with "squash" in the last two lines.

mattolenik commented 8 years ago

Done

hibri commented 8 years ago

Thanks @mattolenik Merged and published.