diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ebcac6..707ea220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Features -- $BAT_CONFIG_DIR is now a recognized environment variable and has precedent over $XDG_CONFIG_HOME. (@billrisher) +- `$BAT_CONFIG_DIR` is now a recognized environment variable. It has precedence over `$XDG_CONFIG_HOME`, see #1727 (@billrisher) ## Bugfixes diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 942894fd..7edb10b9 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -40,6 +40,7 @@ fn bat_raw_command_with_config() -> Command { cmd.env_remove("BAT_STYLE"); cmd.env_remove("BAT_THEME"); cmd.env_remove("BAT_TABS"); + cmd.env_remove("BAT_CONFIG_DIR"); cmd } @@ -749,21 +750,15 @@ fn config_location_when_generating() { #[test] fn config_location_from_bat_config_dir_variable() { - let bat_conf_dir = tempdir().expect("can't create temporary directory.").path().join("bat_conf_dir/"); - - // Create file at BAT_CONFIG_DIR bat_with_config() - .env("BAT_CONFIG_DIR", bat_conf_dir.to_str().unwrap()) - .arg("--generate-config-file") + .env("BAT_CONFIG_DIR", "conf/") + .arg("--config-file") .assert() .success() .stdout( - predicate::str::is_match("Success! Config file written to .*config\n") + predicate::str::is_match("conf/config\n") .unwrap() ); - - // Ensure generated config file exists. - assert!(bat_conf_dir.join("config").exists()); } #[test]