File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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]
2024fn cli_reports_missing_input_path ( ) {
2125 let tmp = TempDir :: new ( ) . unwrap ( ) ;
@@ -231,7 +235,7 @@ fn config_check_rejects_missing_default_config() {
231235fn 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() {
256260fn 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
You can’t perform that action at this time.
0 commit comments