Skip to content

Fluent-style test assertions for Rust, inspired by FluentAssertions and Shouldly.

License

Notifications You must be signed in to change notification settings

tarrball/shoulds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shoulds

Crates.io

shoulds is a fluent assertion library for Rust tests, inspired by FluentAssertions and Shouldly.

It helps you write readable, intention-revealing tests like:

use shoulds::Shouldable;

#[test]
fn adds_numbers_correctly() {
    let result = 40 + 2;

    result.should().eq(&42);
}

The API is designed to be intuitive and discoverable, so you can express expectations naturally—with minimal boilerplate and maximum clarity.


✨ Assertions

Currently supported:

🔢 Equality

  • should().eq(&expected)
  • should().ne(&unexpected)

✅ Booleans

  • should().be_true()
  • should().be_false()

🧩 Option

  • should().be_some()
  • should().be_none()

🧪 Result

  • should().be_ok()
  • should().be_err()

📦 Installation

In your Cargo.toml:

[dev-dependencies]
shoulds = "0.3.0"

📄 License

MIT

About

Fluent-style test assertions for Rust, inspired by FluentAssertions and Shouldly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages