> On Jan 22, 2020, at 12:25 PM, Felipe Gasper <fel...@felipegasper.com> wrote: > > Hi Dan, > > Thank you for your response! > > So, maybe what I need isn’t Test::Mojo. I have: > > ----- > package t::MockApp; > > use Mojo::Base -strict; > > use Mojolicious::Lite; > > websocket '/my-websocket-endpoint' => sub { ... } > ----- > > … and I’d like my tested $ua (Mojo::UserAgent->new()) to call logic > defined in t::MockApp, rather than going out to the real world. I’d also like > to define other mock server classes and have other parts of the test use > those classes instead. > > I’ve tried “$ua->server->app($TEST_MOJO_APP) if $TEST_MOJO_APP” in my > tested code, but that doesn’t seem to work. (The client times out rather than > connecting to my WS server logic.)
Follow-up: I have this working but only if I alter the tested logic to give a relative URL rather than an absolute URL to $tx->websocket(). Is there any tooling in place for handling absolute URLs in such setups? I can override $tx->websocket() but wonder if there’s any ready-made sugar for this. Thank you! -FG -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/C643F292-7C2E-4E82-B794-9B4446AD4D6E%40felipegasper.com.