From bfc2bbdeae6007638611bd31e7cd91ce29d7d690 Mon Sep 17 00:00:00 2001 From: Fabricio Dematte Date: Mon, 24 May 2021 18:38:10 -0300 Subject: [PATCH] add custom config file test --- tests/integration.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 0bf3b44..f71f2b0 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -551,3 +551,20 @@ fn test_upper_case_ext_icon_match() { .assert() .stdout(predicate::str::contains("\u{f410}")); } + +#[cfg(unix)] +#[test] +fn test_custom_config_file_parsing() { + let dir = tempdir(); + dir.child("config.yaml").write_str("layout: tree").unwrap(); + dir.child("folder").create_dir_all().unwrap(); + dir.child("folder/file").touch().unwrap(); + let custom_config = dir.path().join("config.yaml"); + + cmd() + .arg("--config-file") + .arg(custom_config) + .arg(dir.child("folder").path()) + .assert() + .stdout(predicate::str::is_match("folder\n└── file").unwrap()); +}