From d157c87460a0f21ccb883f82105f02f4d595175b Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Wed, 20 Nov 2019 01:35:29 -0600 Subject: [PATCH] Add missing `--init` test (#543) --- tests/init.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/init.rs b/tests/init.rs index 655165d..74ea28e 100644 --- a/tests/init.rs +++ b/tests/init.rs @@ -65,6 +65,27 @@ fn invocation_directory() { ); } +#[test] +fn parent_dir() { + let tmp = tmptree! { + ".git": {}, + sub: {}, + }; + + let output = Command::new(executable_path("just")) + .current_dir(tmp.path().join("sub")) + .arg("--init") + .output() + .unwrap(); + + assert!(output.status.success()); + + assert_eq!( + fs::read_to_string(tmp.path().join("justfile")).unwrap(), + EXPECTED + ); +} + #[test] fn alternate_marker() { let tmp = tmptree! {