(&self, program: &str, args: &[&str])
| 17 | |
| 18 | impl Fixture { |
| 19 | fn command(&self, program: &str, args: &[&str]) -> Output { |
| 20 | let mut command = Command::new(program); |
| 21 | for (name, _) in std::env::vars_os() { |
| 22 | let text = name.to_string_lossy(); |
| 23 | if text.starts_with("ATOMIC_") |
| 24 | || text.starts_with("OPENCODE_") |
| 25 | || text.starts_with("GIT_") |
| 26 | { |
| 27 | command.env_remove(name); |
| 28 | } |
| 29 | } |
| 30 | command |
| 31 | .args(args) |
| 32 | .current_dir(self.root.path()) |
| 33 | .env("HOME", self.home.path()) |
| 34 | .env("ATOMIC_HOME", self.home.path().join(".atomic")) |
| 35 | .env("ATOMIC_CONFIG_DIR", self.home.path().join(".atomic")) |
| 36 | .env("ATOMIC_SERVICE", "local") |
| 37 | .env("ATOMIC_NONINTERACTIVE", "1") |
| 38 | .env("GIT_CONFIG_NOSYSTEM", "1") |
| 39 | .env("GIT_CONFIG_GLOBAL", "/dev/null") |
| 40 | .env("GIT_AUTHOR_NAME", "Snapshot regression") |
| 41 | .env("GIT_AUTHOR_EMAIL", "snapshot@example.invalid") |
| 42 | .env("GIT_COMMITTER_NAME", "Snapshot regression") |
| 43 | .env("GIT_COMMITTER_EMAIL", "snapshot@example.invalid") |
| 44 | .env("NO_COLOR", "1") |
| 45 | .output() |
| 46 | .unwrap() |
| 47 | } |
| 48 | |
| 49 | fn ok(&self, program: &str, args: &[&str]) -> String { |
| 50 | let output = self.command(program, args); |
no test coverage detected