mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-06 11:00:20 +00:00
test: Add more kubectx tests (#111)
This commit is contained in:
committed by
Ahmet Alp Balkan
parent
845f3b690b
commit
acbf324464
22
test/common.bash
Normal file
22
test/common.bash
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
# bats setup function
|
||||
setup() {
|
||||
export XDG_CACHE_HOME="$(mktemp -d)"
|
||||
export KUBECONFIG="${XDG_CACHE_HOME}/config"
|
||||
}
|
||||
|
||||
# bats teardown function
|
||||
teardown() {
|
||||
rm -rf "$XDG_CACHE_HOME"
|
||||
}
|
||||
|
||||
use_config() {
|
||||
cp "$BATS_TEST_DIRNAME/testdata/$1" $KUBECONFIG
|
||||
}
|
||||
|
||||
# wrappers around "kubectl config" command
|
||||
|
||||
get_context() {
|
||||
kubectl config current-context
|
||||
}
|
Reference in New Issue
Block a user