From 37e1ed403aca2d4b091164a432e3ee5cf82f605f Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 26 Feb 2023 16:27:22 -0800 Subject: [PATCH] tests: add test of `jj config edit --repo` outside of repo I'm about to change the implementation a bit, so let's have a test for it. --- tests/test_config_command.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_config_command.rs b/tests/test_config_command.rs index 1ee7a4583..53db52ab9 100644 --- a/tests/test_config_command.rs +++ b/tests/test_config_command.rs @@ -312,6 +312,15 @@ fn test_config_edit_repo() { test_env.jj_cmd_success(&repo_path, &["config", "edit", "--repo"]); } +#[test] +fn test_config_edit_repo_outside_repo() { + let test_env = TestEnvironment::default(); + let stderr = test_env.jj_cmd_failure(test_env.env_root(), &["config", "edit", "--repo"]); + insta::assert_snapshot!(stderr, @r###" + Error: There is no jj repo in "." + "###); +} + fn find_stdout_lines(keyname_pattern: &str, stdout: &str) -> String { let key_line_re = Regex::new(&format!(r"(?m)^{keyname_pattern}=.*$")).unwrap(); key_line_re