Rusto - Testeranto Implementation for Rust
Rusto is a Rust implementation of the Testeranto BDD testing framework.
Overview
This crate provides a Rust implementation of the Testeranto testing framework, following the same patterns as other language implementations (TypeScript, Python, Go, Ruby).
Structure
src/types.rs: Core type definitions and traitssrc/base_suite.rs: BaseSuite struct for test suitessrc/base_given.rs: BaseGiven struct for Given conditionssrc/base_when.rs: BaseWhen struct for When actionssrc/base_then.rs: BaseThen struct for Then assertionssrc/simple_adapter.rs: SimpleTestAdapter default implementationsrc/rusto.rs: Main Rusto struct and entry point
Usage
Add to your Cargo.toml:
[]
= { = "./src/lib/rusto" }
Basic example:
use ;
use async_trait;
// Define your test implementation
let implementation = ITestImplementation ;
// Create Rusto instance
let rusto = new;
// Run tests
let results = rusto.receive_test_resource_config.await;
Testing
Run tests with:
Integration
Rusto follows the same patterns as other Testeranto implementations:
- Test Resource Configuration: Passed as JSON string
- Results Output: Writes to
testeranto/reports/allTests/example/rust.Calculator.test.ts.json - Async Support: Built on Tokio for async operations
- Error Handling: Uses
thiserrorfor comprehensive error types
Future Enhancements
- WebSocket Support: Real-time test reporting
- More Adapters: Specialized adapter implementations
- Performance Optimizations: Lever Rust's performance characteristics
- Macro Support: DSL macros for cleaner test definitions
See Also
- Tiposkripto - TypeScript/JavaScript implementation
- Pitono - Python implementation
- Golingvu - Go implementation
- Rubeno - Ruby implementation