lipanski / mockito

HTTP mocking for Rust!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could mockito provide an URL macro

bbigras opened this issue · comments

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.

@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.

Perfect. Thanks!