summaryrefslogtreecommitdiffstats
path: root/tests/testsuite/git_status.rs
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-09-02 20:14:45 -0400
committerMatan Kushner <hello@matchai.me>2019-09-02 20:27:04 -0400
commit470648000f6025014faafbfe922161e05f432914 (patch)
treee4e989fb609ece1c0d6926e4b0bba1ba1ea1eb2c /tests/testsuite/git_status.rs
parent722a0652fd3a3c0a1cb9fb3133f4304d8df672d0 (diff)
test: Add an integration test for disabling untracked files
Diffstat (limited to 'tests/testsuite/git_status.rs')
-rw-r--r--tests/testsuite/git_status.rs29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/testsuite/git_status.rs b/tests/testsuite/git_status.rs
index 4fd213b0a..510d1baaa 100644
--- a/tests/testsuite/git_status.rs
+++ b/tests/testsuite/git_status.rs
@@ -191,6 +191,33 @@ fn shows_untracked_file() -> io::Result<()> {
#[test]
#[ignore]
+fn doesnt_show_untracked_file_if_disabled() -> io::Result<()> {
+ let fixture_repo_dir = 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();
+
+ File::create(repo_dir.join("license"))?;
+
+ Command::new("git")
+ .args(&["config", "status.showUntrackedFiles", "no"])
+ .current_dir(repo_dir.as_path())
+ .output()?;
+
+ let output = common::render_module("git_status")
+ .arg("--path")
+ .arg(repo_dir)
+ .output()?;
+ let actual = String::from_utf8(output.stdout).unwrap();
+ let expected = "";
+
+ assert_eq!(expected, actual);
+
+ Ok(())
+}
+
+#[test]
+#[ignore]
fn shows_stashed() -> io::Result<()> {
let fixture_repo_dir = create_fixture_repo()?;
let repo_dir = common::new_tempdir()?.path().join("rocket");
@@ -240,7 +267,7 @@ fn shows_modified() -> io::Result<()> {
#[test]
#[ignore]
-fn shows_added_file() -> io::Result<()> {
+fn shows_staged_file() -> io::Result<()> {
let fixture_repo_dir = create_fixture_repo()?;
let repo_dir = common::new_tempdir()?.path().join("rocket");