speculate2

An RSpec inspired minimal testing framework for Rust. (This is an updated and partially rewritten fork for Rust 2021, with updated dependencies and removed unstable functionality.)

Build Status MIT licensed

Installation

Add speculate to the dev-dependencies section of your Cargo.toml:

toml [dev-dependencies] speculate2 = "0.2"

And add the following to the top of the Rust file you want to add tests for:

```rust

[cfg(test)]

use speculate2::speculate; // Must be imported into the current scope. ```

Usage

Speculate provides the speculate! syntax extension. Inside speculate! { ... }, you can have any "Item", like static, const, fn, etc, and 5 special types of blocks:

License

Licensed same as the original repository, under MIT License. A copy can be found in the repo root.