Skip to main content

Crate rskit_testutil

Crate rskit_testutil 

Source
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 Result is Err.
assert_ok
Assert that a Result is Ok, printing the error on failure.
test_workspace
Create a TestWorkspace whose 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.