Skillshub rust-testing

Rust Testing Best Practices

install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/rust-testing" ~/.claude/skills/comeonoliver-skillshub-rust-testing-7e2ebb && rm -rf "$T"
manifest: skills/pproenca/dot-skills/rust-testing/SKILL.md
source content

Rust Testing Best Practices

Comprehensive testing guide for Rust applications, covering CLI testing, library testing, async patterns, and CI integration. Contains 42 rules across 8 categories, prioritized by impact to guide test design, mocking strategies, and CI optimization.

When to Apply

Reference these guidelines when:

  • Writing unit tests for Rust libraries or modules
  • Creating integration tests for CLI applications
  • Setting up mocking with mockall or trait-based design
  • Testing async code with Tokio
  • Configuring CI pipelines for Rust projects

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Test OrganizationCRITICAL
org-
2Mocking and Test DoublesCRITICAL
mock-
3Async TestingHIGH
async-
4Property-Based TestingHIGH
prop-
5Test Fixtures and SetupMEDIUM
fix-
6Assertions and Error TestingMEDIUM
assert-
7CI IntegrationMEDIUM
ci-
8Test PerformanceLOW-MEDIUM
perf-

Quick Reference

1. Test Organization (CRITICAL)

2. Mocking and Test Doubles (CRITICAL)

3. Async Testing (HIGH)

4. Property-Based Testing (HIGH)

5. Test Fixtures and Setup (MEDIUM)

6. Assertions and Error Testing (MEDIUM)

7. CI Integration (MEDIUM)

8. Test Performance (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information