Skip to content

Commit 088eb1a

Browse files
committed
fix: doctor behaviour on various OS
1 parent 6c07f39 commit 088eb1a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/cli_coverage.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ fn default_config_path(config_root: &Path) -> PathBuf {
1616
config_root.join("paperdown.toml")
1717
}
1818

19+
fn default_env_file_for_cwd(tmp: &TempDir) -> PathBuf {
20+
std::fs::canonicalize(tmp.path()).unwrap().join(".env")
21+
}
22+
1923
#[test]
2024
fn cli_reports_missing_input_path() {
2125
let tmp = TempDir::new().unwrap();
@@ -231,7 +235,7 @@ fn config_check_rejects_missing_default_config() {
231235
fn doctor_reports_missing_auth_without_input() {
232236
let tmp = TempDir::new().unwrap();
233237
let config_root = test_config_root(&tmp);
234-
let env_file = tmp.path().join(".env");
238+
let env_file = default_env_file_for_cwd(&tmp);
235239

236240
let mut cmd = Command::cargo_bin("paperdown").unwrap();
237241
let output = cmd
@@ -256,7 +260,7 @@ fn doctor_reports_missing_auth_without_input() {
256260
fn doctor_accepts_environment_auth_without_input() {
257261
let tmp = TempDir::new().unwrap();
258262
let config_root = test_config_root(&tmp);
259-
let env_file = tmp.path().join(".env");
263+
let env_file = default_env_file_for_cwd(&tmp);
260264

261265
let mut cmd = Command::cargo_bin("paperdown").unwrap();
262266
let output = cmd

0 commit comments

Comments
 (0)