Explore the Rust Advanced Testing Workshop curriculum
mainThis workshop provides a structured learning path for advanced testing techniques in Rust. The curriculum is divided into several key modules:
- Better Assertions: Moving beyond standard assertions using
googletestfor matchers (Eq, Option, Result, Enums, Collections), custom matchers, andexpect_that!. - Snapshot Testing: Using
instafor snapshot testing, managing storage locations, and implementing redactions. - Mocks: Implementing mocks using
mockall, including handling traits, call sequences, checkpoints, and mocking foreign traits. - Filesystem Isolation: Using
tempfileandnamed_tempfileto manage temporary files and directories safely during tests. - Database Isolation: Using
sqlx::testfor isolated database testing. - HTTP Mocking: Using
wiremockto mock HTTP services, including the use of matchers and checkpoints. - Macros: Learning how to write test-related macros, from no-op macros to parsing tokens and arguments.
- Test Harnesses: Creating custom test harnesses and using
libtest_mimicfor CLI-based testing.
The workshop concludes with a Capstone project to apply these integrated skills.