Closed Pet3ris closed 1 year ago
Your exact code works for me. Please post a complete example.
Could this have something to do with tokio-test
?
#[cfg(test)]
mod tests {
use async_trait::async_trait;
use mockall::*;
use super::*;
#[tokio::test]
async fn test_mockall() {
trait Zen {
fn zen() -> Option<Self> where Self: Sized;
}
mock! {
pub Z {}
impl Zen for Z {
fn zen() -> Option<Self> where Self: Sized;
}
}
}
}
This works:
#[cfg(test)]
mod tests {
use async_trait::async_trait;
use mockall::*;
use super::*;
trait Zen {
fn zen() -> Option<Self> where Self: Sized;
}
mock! {
pub Z {}
impl Zen for Z {
fn zen() -> Option<Self> where Self: Sized;
}
}
#[tokio::test]
async fn test_mockall() {
let mock = MockZ::new();
}
}
Don't seem to be able to mock the following trait:
In
mockall = "0.11.2"
.Detailed error