Fix tests for travis

pull/73/head
Bruno Sutic 2015-02-22 22:45:06 +01:00
parent 157bd5e38a
commit a3dd99085a
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
4 changed files with 15 additions and 8 deletions

View File

@ -34,8 +34,7 @@ new_tmux_window
# session yellow # session yellow
new_tmux_session "yellow" new_tmux_session "yellow"
run_shell_command "mkdir bar" run_shell_command "cd /tmp/bar"
run_shell_command "cd bar"
start_resurrect_save start_resurrect_save

View File

@ -1,8 +1,11 @@
install_tmux_resurrect_helper() { install_tmux_resurrect_helper() {
rm -rf ~/.tmux/plugins/tmux-resurrect/ local plugin_path="${HOME}/.tmux/plugins/tmux-resurrect/"
cd "$CURRENT_DIR" rm -rf "$plugin_path"
git clone --recursive ../ ~/.tmux/plugins/tmux-resurrect/ >/dev/null 2>&1 if [ -n "$TRAVIS" ]; then
cd - >/dev/null git clone --recursive https://github.com/tmux-plugins/tmux-resurrect --branch "$TRAVIS_BRANCH" "$plugin_path" >/dev/null 2>&1
else # used on vagrant
git clone --recursive "${CURRENT_DIR}/../" "$plugin_path" >/dev/null 2>&1
fi
} }
# we want "fixed" dimensions no matter the size of real display # we want "fixed" dimensions no matter the size of real display

View File

@ -5,10 +5,14 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $CURRENT_DIR/helpers/helpers.sh source $CURRENT_DIR/helpers/helpers.sh
source $CURRENT_DIR/helpers/resurrect_helpers.sh source $CURRENT_DIR/helpers/resurrect_helpers.sh
setup_file_for_restore() { setup_before_restore() {
# setup restore file
mkdir -p ~/.tmux/resurrect/ mkdir -p ~/.tmux/resurrect/
cp tests/fixtures/restore_file.txt "${HOME}/.tmux/resurrect/restore_file.txt" cp tests/fixtures/restore_file.txt "${HOME}/.tmux/resurrect/restore_file.txt"
ln -sf restore_file.txt "${HOME}/.tmux/resurrect/last" ln -sf restore_file.txt "${HOME}/.tmux/resurrect/last"
# directory used in restored tmux session
mkdir -p /tmp/bar
} }
restore_tmux_environment_and_save_again() { restore_tmux_environment_and_save_again() {
@ -21,7 +25,7 @@ restore_tmux_environment_and_save_again() {
main() { main() {
install_tmux_resurrect_helper install_tmux_resurrect_helper
setup_file_for_restore setup_before_restore
restore_tmux_environment_and_save_again restore_tmux_environment_and_save_again
if last_save_file_differs_helper "tests/fixtures/restore_file.txt"; then if last_save_file_differs_helper "tests/fixtures/restore_file.txt"; then

View File

@ -15,6 +15,7 @@ create_tmux_test_environment_and_save() {
main() { main() {
install_tmux_resurrect_helper install_tmux_resurrect_helper
mkdir -p /tmp/bar # setup required dirs
create_tmux_test_environment_and_save create_tmux_test_environment_and_save
if last_save_file_differs_helper "tests/fixtures/save_file.txt"; then if last_save_file_differs_helper "tests/fixtures/save_file.txt"; then