Skip to content

Mock implementations for Rust, for use in testing

License

Notifications You must be signed in to change notification settings

danwilliams/sham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sham

Rust Crate version CI Docs License

/ʃam/
noun - a thing that is not what it is purported to be.
adjective - not genuine; fake or false.
verb - falsely present something as the truth.

Sham is a collection of useful mocks and fakes for testing Rust code. The primary purpose is to be able to swap out a genuine implementation and substitute it with a sham one, in order to achieve deterministic testing without side effects.

This is particularly useful for testing code that usually performs a particular operation that is either expensive, slow, or has side effects that are undesirable in a test environment, such as sending network requests. In these cases, a sham implementation can be used to simulate the real one, without actually performing the operation.

The main crate is sham, and the other crates rely on it or provide secondary functionality in some way. This repository as a whole shares a name with the main crate. You can read about the naming and purpose of each crate in their respective README files.

Crates

  • sham - The main crate, containing the Sham library.

About

Mock implementations for Rust, for use in testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages