# Trait cargo_test_support::TestEnv

source ·

    pub trait TestEnv: Sized {
        // Required methods
        fn current_dir<S: AsRef<Path>>(self, path: S) -> Self;
        fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self;
        fn env_remove(self, key: &str) -> Self;

        // Provided method
        fn test_env(self) -> Self { ... }
    }

Expand description

Establish a process’s test environment

## Required Methods§

source

#### fn current_dir<S: AsRef<Path>>(self, path: S) -> Self

source

#### fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self

source

#### fn env_remove(self, key: &str) -> Self

## Provided Methods§

source

#### fn test_env(self) -> Self

## Implementations on Foreign Types§

source§

### impl TestEnv for Command

source§

#### fn current_dir<S: AsRef<Path>>(self, path: S) -> Self

source§

#### fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self

source§

#### fn env_remove(self, key: &str) -> Self

source§

### impl TestEnv for &mut ProcessBuilder

source§

#### fn current_dir<S: AsRef<Path>>(self, path: S) -> Self

source§

#### fn env<S: AsRef<OsStr>>(self, key: &str, value: S) -> Self

source§

#### fn env_remove(self, key: &str) -> Self

## Implementors§