pub struct TestContext {
pub temp_dir: TempDir,
pub db_path: PathBuf,
pub database: Database,
/* private fields */
}Expand description
Test utilities for setting up isolated test environments
Fields§
§temp_dir: TempDir§db_path: PathBuf§database: DatabaseImplementations§
Source§impl TestContext
impl TestContext
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Get the database connection
Sourcepub fn create_temp_project_dir(&self) -> Result<PathBuf>
pub fn create_temp_project_dir(&self) -> Result<PathBuf>
Create a temporary project directory
Sourcepub fn create_temp_git_repo(&self) -> Result<PathBuf>
pub fn create_temp_git_repo(&self) -> Result<PathBuf>
Create a temporary Git repository for testing
Sourcepub fn create_temp_tempo_project(&self) -> Result<PathBuf>
pub fn create_temp_tempo_project(&self) -> Result<PathBuf>
Create a temporary Tempo-tracked project directory
Auto Trait Implementations§
impl !Freeze for TestContext
impl !RefUnwindSafe for TestContext
impl Send for TestContext
impl !Sync for TestContext
impl Unpin for TestContext
impl !UnwindSafe for TestContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more