diff options
author | Neil Kistner <neil.kistner@gmail.com> | 2019-09-07 11:25:01 -0500 |
---|---|---|
committer | Kevin Song <chipbuster@users.noreply.github.com> | 2019-09-07 11:25:01 -0500 |
commit | 6658b7f0aa09f2edb96bfe7c7be25377b939f2be (patch) | |
tree | 5cc6f013552cf92181b3fe6073fb01664be6dd4b /tests/testsuite/git_status.rs | |
parent | 3435b9cdc219afce1af1db98d68a7dfefb1653ab (diff) |
fix: Fixture repo will now clone and set git config locally (#307)
Diffstat (limited to 'tests/testsuite/git_status.rs')
-rw-r--r-- | tests/testsuite/git_status.rs | 70 |
1 files changed, 14 insertions, 56 deletions
diff --git a/tests/testsuite/git_status.rs b/tests/testsuite/git_status.rs index 4b75d0a05..e2be95c21 100644 --- a/tests/testsuite/git_status.rs +++ b/tests/testsuite/git_status.rs @@ -10,10 +10,7 @@ use crate::common::{self, TestCommand}; #[test] #[ignore] fn shows_behind() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["reset", "--hard", "HEAD^"]) @@ -35,10 +32,7 @@ fn shows_behind() -> io::Result<()> { #[test] #[ignore] fn shows_behind_with_count() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["reset", "--hard", "HEAD^"]) @@ -67,10 +61,7 @@ fn shows_behind_with_count() -> io::Result<()> { #[test] #[ignore] fn shows_ahead() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("readme.md"))?; @@ -94,10 +85,7 @@ fn shows_ahead() -> io::Result<()> { #[test] #[ignore] fn shows_ahead_with_count() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("readme.md"))?; @@ -128,10 +116,7 @@ fn shows_ahead_with_count() -> io::Result<()> { #[test] #[ignore] fn shows_diverged() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["reset", "--hard", "HEAD^"]) @@ -160,10 +145,7 @@ fn shows_diverged() -> io::Result<()> { #[test] #[ignore] fn shows_diverged_with_count() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["reset", "--hard", "HEAD^"]) @@ -199,10 +181,7 @@ fn shows_diverged_with_count() -> io::Result<()> { #[test] #[ignore] fn shows_conflicted() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["reset", "--hard", "HEAD^"]) @@ -241,10 +220,7 @@ fn shows_conflicted() -> io::Result<()> { #[test] #[ignore] fn shows_untracked_file() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("license"))?; @@ -263,10 +239,7 @@ fn shows_untracked_file() -> io::Result<()> { #[test] #[ignore] fn doesnt_show_untracked_file_if_disabled() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("license"))?; @@ -290,10 +263,7 @@ fn doesnt_show_untracked_file_if_disabled() -> io::Result<()> { #[test] #[ignore] fn shows_stashed() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("readme.md"))?; @@ -317,10 +287,7 @@ fn shows_stashed() -> io::Result<()> { #[test] #[ignore] fn shows_modified() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("readme.md"))?; @@ -339,10 +306,7 @@ fn shows_modified() -> io::Result<()> { #[test] #[ignore] fn shows_staged_file() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; File::create(repo_dir.join("license"))?; @@ -366,10 +330,7 @@ fn shows_staged_file() -> io::Result<()> { #[test] #[ignore] fn shows_renamed_file() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; Command::new("git") .args(&["mv", "readme.md", "readme.md.bak"]) @@ -396,10 +357,7 @@ fn shows_renamed_file() -> io::Result<()> { #[test] #[ignore] fn shows_deleted_file() -> io::Result<()> { - 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(); + let repo_dir = common::create_fixture_repo()?; fs::remove_file(repo_dir.join("readme.md"))?; |