Expand description
Test utilities, mock providers, and assertion helpers.
Designed for use in #[cfg(test)] blocks and integration tests across the rskit ecosystem.
TestWorkspace is the generic fixture harness.
Configure any fixture root with TestWorkspace::with_fixture_dir,
or use test_workspace! for the conventional <crate>/tests/fixtures layout.
Re-exports§
pub use assertions::assert_err_code;pub use assertions::assert_ok;pub use component::FakeComponent;pub use config::TestAppConfig;pub use current_dir::CurrentDirGuard;pub use hook::TestEvent;pub use mock_provider::MockProvider;pub use workspace::TestWorkspace;
Modules§
- assertions
- Assertion helpers for
AppResult. - component
- Fake components for lifecycle tests. Component test doubles.
- config
- Test config helpers. Config test helpers.
- current_
dir - Process working-directory guard for tests. Process-current-directory guard for tests.
- hook
- Hook and event-bus test helpers. Hook test helpers.
- mock_
provider - Generic mock provider for testing.
- workspace
- Temporary workspace and fixture helpers. Temporary workspace and fixture helpers for tests.
Macros§
- assert_
err - Assert that a
ResultisErr. - assert_
ok - Assert that a
ResultisOk, printing the error on failure. - test_
workspace - Create a
TestWorkspacewhose fixture root is<caller>/tests/fixtures.
Constants§
- CONCURRENCY_
TEST_ NOTE - Use
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]for tests that exercise concurrent code paths. Plain#[tokio::test]uses a single-threaded runtime and will NOT catch data races.