MCPcopy Create free account
hub / github.com/dashed/git-chain / no_subcommand

Function no_subcommand

tests/misc.rs:12–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11#[test]
12fn no_subcommand() {
13 let repo_name = "no_subcommand";
14 let repo = setup_git_repo(repo_name);
15 let path_to_repo = generate_path_to_repo(repo_name);
16
17 {
18 // create new file
19 create_new_file(&path_to_repo, "hello_world.txt", "Hello, world!");
20
21 // add first commit to master
22 first_commit_all(&repo, "first commit");
23 };
24
25 assert_eq!(&get_current_branch_name(&repo), "master");
26
27 let args: Vec<String> = vec![];
28 let output = run_test_bin_expect_err(path_to_repo, args);
29 assert!(String::from_utf8_lossy(&output.stdout).contains("On branch: master"));
30 assert!(
31 String::from_utf8_lossy(&output.stderr).contains("Branch is not part of any chain: master")
32 );
33
34 teardown_git_repo(repo_name);
35}
36
37#[test]
38fn not_a_git_repo() {

Callers

nothing calls this directly

Calls 6

setup_git_repoFunction · 0.85
generate_path_to_repoFunction · 0.85
create_new_fileFunction · 0.85
first_commit_allFunction · 0.85
run_test_bin_expect_errFunction · 0.85
teardown_git_repoFunction · 0.85

Tested by

no test coverage detected