#assertions #fluent #test-cases

fluent-assertions

A Rust testing library that enhances readability and expressiveness by enabling natural language-like syntax for test assertions

3 releases (breaking)

0.3.0 Jan 8, 2024
0.2.0 Aug 15, 2023
0.1.0 Apr 4, 2023

#339 in Testing

Download history 538/week @ 2024-01-09 658/week @ 2024-01-16 358/week @ 2024-01-23 463/week @ 2024-01-30 398/week @ 2024-02-06 290/week @ 2024-02-13 490/week @ 2024-02-20 221/week @ 2024-02-27 278/week @ 2024-03-05 268/week @ 2024-03-12 259/week @ 2024-03-19 196/week @ 2024-03-26 224/week @ 2024-04-02 76/week @ 2024-04-09 101/week @ 2024-04-16 147/week @ 2024-04-23

562 downloads per month

MIT/Apache

17KB
462 lines

Introduction

A fluent assertions framework for Rust, inspired by the renowned Fluent Assertions framework in .NET. This powerful library aims to make your Rust test assertions more expressive, readable, and maintainable by enabling a natural language-like syntax for your test cases.

fluent-assertions provides an extensive set of assertion methods that are both easy to use and understand. These methods are designed to work seamlessly with Rust's core testing functionality, allowing you to write tests that are not only more expressive but also more enjoyable to read and write.

With fluent-assertions, you can chain assertions with ease, allowing for complex validations without sacrificing readability. This framework also comes with informative error messages, making it easier to debug and pinpoint the source of failures in your test suite.

Whether you're new to Rust or an experienced developer, fluent-assertions is designed to help you write cleaner, more readable tests that effectively communicate their intent. With this powerful library at your disposal, you'll be able to focus on what matters most: building reliable and efficient Rust applications.

Usage

Examples

cargo run --example asserts

License

Licensed under either of

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~155KB