-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public interface for regression tests? #136
Comments
Yes, I think we should at least document how to test without opening sockets. I don't think this is only useful for regression testing. All you need to do is I don't know what the public interface should be, opinions welcome or I'll just experiment :) The normal way to get a string from a vector of bytes would be |
Perhaps make
Oh, I dislike |
I talked about removing mk_response in another PR and might do that. Making App callable is what I was thinking of doing, too, but I haven't thought it all through yet :) I'd probably just define this if I did: (app::App)(x) = app.warex(x) I don't think it's our responsibility to provide easier ways of creating HTTP request objects, or if we did do that, it can be in a Mux.Request function or something? |
I think Making the definition, It's not |
Currently,
Mux
doesn't exporthttp_handler
in its public interface, yet, something like it is required to build regression tests that don't open a socket. Indeed, opening a socket isn't really required to test Mux... you just send a Request and get a Response object. Here is a rough stab at a trivial wrapper to makeget
andpost
requests where one could typeget("/")
to print the given response to stdout.Something similar might be nice to include so that application developers could test their interfaces w/o having a webserver active. Generally, we might wish to also consider updating regression tests in this project to use a similar method. There's no real need to test most of the functionality via sockets. At this level in the stack what's matter is functionality via Request/Response.
The text was updated successfully, but these errors were encountered: