1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-28 12:10:52 +00:00

test: Add an integration test for disabling untracked files

This commit is contained in:
Matan Kushner 2019-09-02 20:14:45 -04:00
parent 722a0652fd
commit 470648000f

View File

@ -189,6 +189,33 @@ fn shows_untracked_file() -> io::Result<()> {
Ok(())
}
#[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<()> {
@ -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");