Could mockito provide an URL macro
bbigras opened this issue · comments
Bruno Bigras commented
something like:
let url = mockurl!("https://api.twitter.com");
instead of:
#[cfg(not(test))]
let url = "https://api.twitter.com";
#[cfg(test)]
let url = &mockito::server_url();
that would do the same thing.
Florin Lipan commented
@bbigras thanks for raising the issue. mid/long-term I'm looking into getting rid of those compiler flags entirely in favour of using one or more server variables per test - see the discussion around #92 which enables several other things (among which full parallel tests). for this reason I don't think it's worth adding such a macro right now.
Bruno Bigras commented
Perfect. Thanks!