mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-12 23:23:20 +00:00
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.
This commit is contained in:
parent
491ecc6b2e
commit
37e1ed403a
1 changed files with 9 additions and 0 deletions
|
@ -312,6 +312,15 @@ fn test_config_edit_repo() {
|
||||||
test_env.jj_cmd_success(&repo_path, &["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 {
|
fn find_stdout_lines(keyname_pattern: &str, stdout: &str) -> String {
|
||||||
let key_line_re = Regex::new(&format!(r"(?m)^{keyname_pattern}=.*$")).unwrap();
|
let key_line_re = Regex::new(&format!(r"(?m)^{keyname_pattern}=.*$")).unwrap();
|
||||||
key_line_re
|
key_line_re
|
||||||
|
|
Loading…
Reference in a new issue