diff options
author | Neil Kistner <neil.kistner@gmail.com> | 2019-09-03 23:20:22 -0500 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-04 00:20:22 -0400 |
commit | dfade6d6298b52e04dc8622c676ac8174a900587 (patch) | |
tree | b23cc8d8a247204139b628c159653bcd5426e907 /tests/testsuite/git_branch.rs | |
parent | 6db0e205856db7f5ebe417c2e3753d699c212dd9 (diff) |
refactor: Move `create_fixture_repo` into common in integration tests (#282)
Diffstat (limited to 'tests/testsuite/git_branch.rs')
-rw-r--r-- | tests/testsuite/git_branch.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/tests/testsuite/git_branch.rs b/tests/testsuite/git_branch.rs index 16d889b4d..c1cd31015 100644 --- a/tests/testsuite/git_branch.rs +++ b/tests/testsuite/git_branch.rs @@ -106,7 +106,7 @@ fn test_truncate_length_with_config( truncation_symbol: &str, config_options: &str, ) -> io::Result<()> { - let fixture_repo_dir = create_fixture_repo()?; + let fixture_repo_dir = common::create_fixture_repo()?; let repo_dir = common::new_tempdir()?.path().join("rocket"); Repository::clone(fixture_repo_dir.to_str().unwrap(), &repo_dir.as_path()).unwrap(); @@ -141,28 +141,3 @@ fn test_truncate_length_with_config( assert_eq!(expected, actual); Ok(()) } - -fn create_fixture_repo() -> io::Result<std::path::PathBuf> { - let fixture_repo_dir = common::new_tempdir()?.path().join("fixture"); - let fixture = env::current_dir()?.join("tests/fixtures/rocket.bundle"); - - Command::new("git") - .args(&["config", "--global", "user.email", "starship@example.com"]) - .output()?; - - Command::new("git") - .args(&["config", "--global", "user.name", "starship"]) - .output()?; - - Command::new("git") - .args(&[ - "clone", - "-b", - "master", - &fixture.to_str().unwrap(), - fixture_repo_dir.to_str().unwrap(), - ]) - .output()?; - - Ok(fixture_repo_dir) -} |