Crate simulacrum

Source
Expand description

Minimal library for creating mock objects by hand using stable Rust.

This crate is a facade that just re-exports any crates necessary to both create and use mock objects in Simulacrum.

Modules§

constraint
expectation
macros
method
This is the API that you’ll call in your tests when using your Mock objects.
mock
Mock object internals. You can use this API to construct mock objects manually.
validators
Types that impl Validator.

Macros§

create_expect_method
Use this macro to create an .expect_METHOD_NAME() method.
create_mock
create_mock_struct
params
Use this macro to create a Validator that works for methods with 2-9 parameters.
simulacrum_tuplefy
was_called
Use this macro to do a self.e.was_called self.e.was_called_returning with a shorter interface.

Structs§

Expectations
Method
What you get from calling .expect_METHOD_NAME() on a Mock.
Tuple2
Tuple3
Tuple4
Tuple5
Tuple6
Tuple7
Tuple8
Tuple9

Functions§

any
deref
gt
Parameter(s) must be > the provided value.
lt
Parameter(s) must be < the provided value.
none
passes

Type Aliases§

ExpectationId
The keys used in a HandleBox. A typedef for u32.
MethodName