Skip to content

Commit

Permalink
test new without init
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrotenberg committed Mar 11, 2024
1 parent f5f99b8 commit 6d40f11
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,21 @@ fn test_new_link() {
}
}
}

#[test]
#[serial_test::serial]
fn test_new_no_current_dir() {
let temp = TempDir::new().unwrap();
std::env::set_current_dir(temp.path()).unwrap();
std::env::set_var("EDITOR", "cat");

Command::cargo_bin("adrs")
.unwrap()
.arg("new")
.arg("Test new without init")
.assert()
.success();

temp.child("doc/adr/0001-test-new-without-init.md")
.assert(predicates::path::exists());
}

0 comments on commit 6d40f11

Please sign in to comment.