Add "preexec" from "https://github.com/rcaloras/bash-preexec@0.4.1"
git-vendor-name: preexec git-vendor-dir: vendor/github.com/rcaloras/bash-preexec git-vendor-repository: https://github.com/rcaloras/bash-preexec git-vendor-ref: 0.4.1
This commit is contained in:
20
vendor/github.com/rcaloras/bash-preexec/test/include-test.bats
generated
vendored
Normal file
20
vendor/github.com/rcaloras/bash-preexec/test/include-test.bats
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
@test "should not import if it's already defined" {
|
||||
__bp_imported="defined"
|
||||
source "${BATS_TEST_DIRNAME}/../bash-preexec.sh"
|
||||
[ -z $(type -t __bp_preexec_and_precmd_install) ]
|
||||
}
|
||||
|
||||
@test "should import if not defined" {
|
||||
unset __bp_imported
|
||||
source "${BATS_TEST_DIRNAME}/../bash-preexec.sh"
|
||||
[ -n $(type -t __bp_install) ]
|
||||
}
|
||||
|
||||
@test "bp should stop installation if HISTTIMEFORMAT is readonly" {
|
||||
readonly HISTTIMEFORMAT
|
||||
run source "${BATS_TEST_DIRNAME}/../bash-preexec.sh"
|
||||
[ $status -ne 0 ]
|
||||
[[ "$output" =~ "HISTTIMEFORMAT" ]] || return 1
|
||||
}
|
||||
Reference in New Issue
Block a user