Add test for append-to-config option

pull/1723/head
Egor Moor 2020-12-07 08:57:42 +00:00
parent 40bdaec84f
commit f8acb84b9d
1 changed files with 25 additions and 0 deletions

View File

@ -59,3 +59,28 @@ function local_setup {
assert_failure
}
@test "install: verify that no-modify-config and append-to-config can not be used at the same time" {
cd "$BASH_IT"
run ./install.sh --silent --no-modify-config --append-to-config
assert_failure
}
@test "install: verify that the template is appended" {
cd "$BASH_IT"
touch "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
echo "test file content" > "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
./install.sh --silent --append-to-config
assert_file_exist "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
assert_file_exist "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE.bak"
cat "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
assert_line "test file content"
assert_line "source "$BASH_IT"/bash_it.sh"
}