1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-22 07:20:59 +02:00

tests: inject '-t 1' to read during tests

This commit is contained in:
Daniel Hahler 2014-11-21 20:08:30 +01:00
parent c1a25d724e
commit c12b861952
2 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,7 @@ _dotenv_deauthorize() {
# This function can be mocked in tests
_dotenv_read_answer() {
local answer
read -q answer
read $=_AUTOENV_TEST_READ_ARGS -q answer
echo $answer
}

View File

@ -1,3 +1,6 @@
# Ensure we have our mocked out ENV_AUTHORIZATION_FILE
[[ $ENV_AUTHORIZATION_FILE[0,4] == '/tmp' ]] || return 1
# Inject timeout for `read` while running tests.
_AUTOENV_TEST_READ_ARGS='-t 1'