rskit-testutil — Test Utilities
Test utilities, mock providers, and assertion helpers for rskit services.
Features
MockProvider<I, O>— generic mock withwill_return/will_failqueues and call recordingassert_ok(result)— unwrapAppResultor panic with contextassert_err_code(result, code)— assert a specificErrorCodeTestWorkspace/test_workspace!— managed temp workspaces with fixture loading and copying- Thread-safe via
parking_lot::Mutex
TestWorkspace is the generic fixture harness for rskit tests. Use with_fixture_dir when fixtures live outside the default crate layout, or test_workspace! when a crate follows the conventional tests/fixtures directory.
Usage
[]
= "0.2.0-alpha.3"
use ;
use ErrorCode;
let mock = new;
mock.will_return;
let result = mock.execute;
assert_ok;
assert_eq!;
mock.will_fail;
assert_err_code;
use test_workspace;
let workspace = test_workspace!;
let config_path = workspace
.copy_fixture
.unwrap;
assert!;
use TestWorkspace;
let fixtures = from;
let workspace = new.with_fixture_dir;
let _ = workspace.fixture_path;