mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-09-10 21:18:32 +00:00
Do not use (buggy) docker provisioner
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export TEST_FAIL=false
|
||||
FAIL="false"
|
||||
|
||||
set_tmux_conf_helper() {
|
||||
> ~/.tmux.conf # empty filename
|
||||
@ -35,12 +35,15 @@ check_dir_exists_helper() {
|
||||
fi
|
||||
}
|
||||
|
||||
fail_test() {
|
||||
TEST_FAIL=true
|
||||
fail_helper() {
|
||||
local message="$1"
|
||||
echo "Tmux plugin installation fails" >&2
|
||||
FAIL="true"
|
||||
}
|
||||
|
||||
exit_value_helper() {
|
||||
if $TEST_FAIL; then
|
||||
local fail="$1"
|
||||
if [ "$FAIL" == "true" ]; then
|
||||
echo
|
||||
echo "Test failed"
|
||||
exit 1
|
||||
|
@ -7,16 +7,16 @@ source $CURRENT_DIR/test_helpers.sh
|
||||
test_plugin_installation() {
|
||||
set_tmux_conf_helper <<- HERE
|
||||
set -g @tpm_plugins "bruno-/tmux_example_plugin"
|
||||
run-shell '/root/tmux_plugin_manager/tpm'
|
||||
run-shell "~/tpm/tpm"
|
||||
HERE
|
||||
|
||||
# opens tmux and test it with `expect`
|
||||
$CURRENT_DIR/expect_successful_plugin_download ||
|
||||
(echo "Tmux plugin installation fails" >&2; fail_test)
|
||||
fail_helper "Tmux plugin installation fails"
|
||||
|
||||
# check plugin dir exists after download
|
||||
check_dir_exists_helper "/root/.tmux/plugins/tmux_example_plugin/" ||
|
||||
(echo "Plugin download fails" >&2; fail_test)
|
||||
check_dir_exists_helper "$HOME/.tmux/plugins/tmux_example_plugin/" ||
|
||||
fail_helper "Plugin download fails"
|
||||
|
||||
teardown_helper
|
||||
}
|
||||
|
@ -12,8 +12,7 @@ check_binding_defined() {
|
||||
test_plugin_sourcing() {
|
||||
set_tmux_conf_helper <<- HERE
|
||||
set -g @tpm_plugins "doesnt_matter/tmux_test_plugin"
|
||||
# change this
|
||||
run-shell '/root/tmux_plugin_manager/tpm'
|
||||
run-shell "~/tpm/tpm"
|
||||
HERE
|
||||
|
||||
# manually creates a local tmux plugin
|
||||
@ -23,7 +22,7 @@ test_plugin_sourcing() {
|
||||
|
||||
tmux new-session -d # tmux starts detached
|
||||
check_binding_defined "R run-shell foo_command" ||
|
||||
(echo "Plugin sourcing fails" >&2; fail_test)
|
||||
fail_helper "Plugin sourcing fails"
|
||||
|
||||
teardown_helper
|
||||
}
|
||||
|
Reference in New Issue
Block a user