mibes / mockall-async

Sample code to demonstrate the use of mockall with async traits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Mocking asynchronous traits is not as straightforward as one might think. Mockall (https://docs.rs/mockall/0.6.0/mockall) provides a great set of examples for various other use cases, but mocking aync traits is not supported out of the box. This small Rust example demonstrates how to use mockall with async traits. It is based on the workaround listed here: asomers/mockall#75

Usage

cargo test

About

Sample code to demonstrate the use of mockall with async traits

License:Other


Languages

Language:Rust 100.0%