Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

mock Connection #13

Closed
gregwebs opened this issue Aug 12, 2014 · 2 comments
Closed

mock Connection #13

gregwebs opened this issue Aug 12, 2014 · 2 comments

Comments

@gregwebs
Copy link

I would like to run integration tests that don't depend on the network. It appears to me that if I can mock the Connection than I can mock http-client. Do you have any insight on how to initialize a mock connection?

From a quick review of the code, my first try would be use connectFromHandle but give a mock Handle, although now I have to figure out if it is possible to create a mock Handle.

@vincenthz
Copy link
Owner

I think it would be really nice to have a connectFromBsMvar that takes a "MVar [Strict.ByteString]" (or a Chan) for this purpose and would be actually quite generic and useful for testing/mocking.

@gregwebs
Copy link
Author

I decided to go with the approach of writing a fake server rather than trying to mock Haskell data types. It makes a lot more sense for my use case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants