Crate git_testtools
source · [−]Expand description
Utilities for testing gitoxide crates, many of which might be useful for testing programs that use git in general.
Re-exports
Structs
A utility to set environment variables, while unsetting them (or resetting them to their previous value) on drop.
Enums
Define how scripted_fixture_repo_writable_with_args() uses produces the writable copy.
Functions
A utility to copy the entire contents of src_dir into dst_dir.
Load the fixture from <crate-root>/tests/fixtures/<path> and return its data, or panic.
Return the path to the <crate-root>/tests/fixtures/<path> directory.
Convert a hexadecimal hash into its corresponding ObjectId or panic.
Run git in working_dir with all provided args.
Run the executable at script_name, like make_repo.sh to produce a read-only directory to which
the path is returned.
Like scripted_fixture_repo_read_only()], but passes args to script_name.
Run the executable at script_name, like make_repo.sh to produce a writable directory to which
the tempdir is returned. It will be removed automatically, courtesy of tempfile::TempDir.
Like scripted_fixture_repo_writable(), but passes args to script_name while providing control over
the way files are created with mode.
Transform a verbose bom errors from raw bytes into a BStr to make printing/debugging human-readable.
Type Definitions
A result type to allow using the try operator ? in unit tests.