blob: 5800f879b344ce36972be24b6d1454fef838636a [file] [log] [blame]
// vim: tw=80
//! A trait with a constructor method that returns Box<Self>
#![deny(warnings)]
use mockall::*;
#[automock]
pub trait A {
fn new() -> Box<Self>;
}
#[test]
fn returning() {
let ctx = MockA::new_context();
ctx.expect().returning(|| Box::new(MockA::default()));
let _a: Box<MockA> = <MockA as A>::new();
}