diff --git a/mockall_examples/src/lib.rs b/mockall_examples/src/lib.rs index c741f726..7b0f20df 100644 --- a/mockall_examples/src/lib.rs +++ b/mockall_examples/src/lib.rs @@ -1,5 +1,5 @@ // vim: tw=80 -//#![deny(missing_docs)] +#![deny(missing_docs)] //! Examples of mock objects and their generated methods. //! @@ -33,6 +33,28 @@ pub trait Foo { fn bang(x: i32) -> i32; } +/// A trait implemented by a Struct we want to mock +pub trait Bah { + /// Some trait method + fn bah(&self); +} + +#[cfg(doc)] +mock! { + /// structs can be mocked with `mock!` + /// + /// Their mock methods have an identical API to the methods generated by + /// `#[automock]` + pub Boo { + /// A method on a struct + fn boo(&self); + } + /// An implementation of a trait on a mocked struct + trait Bah { + fn bah(&self); + } +} + #[cfg(doc)] #[automock(mod mock_ffi;)] extern "C" {