mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-13 17:57:30 +02:00
feat(config): added recognition of $BAT_CONFIG_DIR
This commit is contained in:
@ -747,6 +747,25 @@ fn config_location_when_generating() {
|
||||
assert!(tmp_config_path.exists());
|
||||
}
|
||||
|
||||
#[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")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(
|
||||
predicate::str::is_match("Success! Config file written to .*config\n")
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
// Ensure generated config file exists.
|
||||
assert!(bat_conf_dir.join("config").exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_read_arguments_from_file() {
|
||||
bat_with_config()
|
||||
|
Reference in New Issue
Block a user