#assertions #testing #fluent #test-cases #error-message

fluent-assertions

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

4 releases (breaking)

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

#685 in Development tools

Download history 604/week @ 2024-08-19 278/week @ 2024-08-26 274/week @ 2024-09-02 53/week @ 2024-09-09 259/week @ 2024-09-16 444/week @ 2024-09-23 123/week @ 2024-09-30 7/week @ 2024-10-07 4/week @ 2024-10-14 223/week @ 2024-11-04 257/week @ 2024-11-11 139/week @ 2024-11-18 146/week @ 2024-11-25 311/week @ 2024-12-02

861 downloads per month

MIT/Apache

17KB
416 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

~150KB