tide/tests/_tide_item_kubectl.test.fish
Branch Vincent 9d16aec7a3
add kubectl item (#178)
* add kube context

* handle missing namespace

* Rename to kubectl

* Minor edits

* Fix test

* Use hex brand colors, add kubectl to right items

Co-authored-by: Ilan Cosman <ilancosman@gmail.com>
2021-07-19 21:35:50 -07:00

20 lines
592 B
Fish

# RUN: %fish %s
function _kubectl
_tide_decolor (_tide_item_kubectl)
end
set -lx tide_kubectl_icon
mock kubectl "config view --minify --output" "echo error: current-context must exist in order to minify >&2; false"
_kubectl # CHECK:
mock kubectl "config view --minify --output" "printf curr-context/default"
_kubectl # CHECK: ⎈ curr-context
mock kubectl "config view --minify --output" "printf curr-context/"
_kubectl # CHECK: ⎈ curr-context
mock kubectl "config view --minify --output" "printf curr-context/curr-namespace"
_kubectl # CHECK: ⎈ curr-context/curr-namespace