Mocktopus icon indicating copy to clipboard operation
Mocktopus copied to clipboard

Mocking framework for Rust

Results 17 Mocktopus issues
Sort by recently updated
recently updated
newest added

This code compiles causing conversion of `&str` to `&'static str`: ```rust #[mockable] fn terrible(_: &str) -> &'static str { "a" } #[test] fn terrible_test() { // This closure has type...

bug
wontfix

Mocktopus is very handy for mocking free functions. But when mocking structs, it requires a real copy of the struct to be instantiated. That's not always easy or possible in...

Hey, what do you think of adding a completly new API to improve readability of mockings. I would suggest something like this: ```rust when(namespace::function) .expected(times(3)) .called_with( is(equal_to(5)), is(none()) ) .returns(7);...

Mocks taking effect in every thread during test runtime. Probably should block other test runs, preferably only multithreaded

No idea, how to do it, compiler plugin passed to rustc maybe?

enhancement

From https://doc.rust-lang.org/beta/unstable-book/library-features/tuple-trait.html it seems the `tuple_trait` feature isn't intended for general use. Does Mocktopus functionality depend on it or could it be removed to make it more likely that Mocktopus...

`as_mut()` cannot be used correctly, any usage will invoke UB. [As the nomicon says](https://doc.rust-lang.org/stable/nomicon/transmutes.html): > * Transmuting an `&` to `&mut` is Undefined Behavior. While certain usages may *appear* safe,...