coliru

A minimal, flexible, dotfile installer
git clone https://git.ashermorgan.net/coliru/
Log | Files | Refs | README

commit f6cb8657e72a42d520b1a132b521a3d2e6c6a118
parent a2aea4ef70a52a0ab5363d752656f63bd2002fc6
Author: Asher Morgan <59518073+ashermorgan@users.noreply.github.com>
Date:   Fri, 28 Jun 2024 10:25:54 -0700

Add test for absolute manifest paths

Diffstat:
Mtests/basic.rs | 29+++++++++++++++++++++++++++++
1 file changed, 29 insertions(+), 0 deletions(-)

diff --git a/tests/basic.rs b/tests/basic.rs @@ -423,3 +423,32 @@ fn test_missing_manifest() { assert_eq!(&stdout_to_string(&mut cmd), ""); assert_eq!(&stderr_to_string(&mut cmd), expected); } + +#[test] +fn test_absolute_manifest() { + let (dir, mut cmd) = setup_e2e("test_absolute_manifest"); + let manifest_path = dir.dir.join("manifest.yml"); + cmd.args([&manifest_path.to_str().unwrap(), "--dry-run", "-t", "linux"]); + manifest_1(&dir.dir); + + let expected = "\ +[1/3] Copy gitconfig to ~/.gitconfig.coliru (DRY RUN) +[2/3] Link bashrc to ~/.bashrc.coliru (DRY RUN) +[2/3] Link vimrc to ~/.vimrc.coliru (DRY RUN) +[2/3] Run sh script.sh arg1 linux (DRY RUN) +"; + assert_eq!(&stdout_to_string(&mut cmd), expected); + assert_eq!(&stderr_to_string(&mut cmd), ""); + + // Assert files are correctly copied/linked/run + let bash_exists = dir.dir.join(".bashrc.coliru").exists(); + let git_exists = dir.dir.join(".gitconfig.coliru").exists(); + let vim1_exists = dir.dir.join(".vimrc.coliru").exists(); + let vim2_exists = dir.dir.join("_vimrc.coliru").exists(); + let log_exists = dir.dir.join("log.txt").exists(); + assert_eq!(bash_exists, false); + assert_eq!(git_exists, false); + assert_eq!(vim1_exists, false); + assert_eq!(vim2_exists, false); + assert_eq!(log_exists, false); +}