Alan Somers

Results 656 comments of Alan Somers

BTW, while Mockall doesn't currently support const generics, it does support associated constants. So you might be able to refactor your code to use those, instead. See https://github.com/asomers/mockall/blob/master/mockall/tests/automock_associated_const.rs for an...

Can you give an example of how you would use this feature?

Ok, I see how this would be useful. And it's one of the rare feature requests that doesn't require changing the proc macros. Would you like to try submitting a...

I agree that `reqwest::get` is probably not something that you should call from within your returning closure. And I also understand how the Captor would be useful for your use...

You probably need an `Arc`, then. That will let you move it into the closure and also save a copy for later. > What's the reason returning is expecting a...

I think the "set expectations before passing the object to the code under test" approach is usually the best approach. At least, that's usually what I do. But I can...

I'm glad you like it! As for your question, one thing immediately comes to mind: you'll get better error messages if you enable the `nightly` crate feature. As its name...

Could you explain in more detail what `spy!` would do? I'm unfamiliar with this Java library.

So it wraps a real object, but records all of its calls for later inspection? I'm sure there would be s lot of hard cases. What about static methods? Generic...

What do you mean "without the code generation"? How would any of this work without code generation?