Fix tmux_attach_start unit tests
This commit is contained in:
parent
66961cae79
commit
f5eddfdab2
1 changed files with 2 additions and 2 deletions
|
|
@ -1,39 +0,0 @@
|
|||
setup() {
|
||||
fut="$BATS_TEST_DIRNAME/../tm"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -rf $BATS_TMPDIR/xdg/*
|
||||
}
|
||||
|
||||
@test "runs correctly if invoked without arguments" {
|
||||
run $fut
|
||||
echo "$BATS_TEST_DIRNAME/../tm"
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "Errors out if passed a non-existent session file (and some session name)" {
|
||||
run $fut IDONT_EXIST_HERE.session sessionname
|
||||
echo "STATUS: $output"
|
||||
[ "$status" -eq 1 ]
|
||||
echo "OUTPUT: $output"
|
||||
[ "$output" = "can not source session file: 'IDONT_EXIST_HERE.session' does not exist." ]
|
||||
}
|
||||
|
||||
@test "Runs without errors when session file exists in PWD" {
|
||||
touch $PWD/exists.session
|
||||
run $fut exists.session sessionname
|
||||
rm $PWD/exists.session
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "Runs without errors when session file exists in XDG_CONFIG_HOME/tmux/sessions/" {
|
||||
export XDG_CONFIG_HOME=$BATS_TMPDIR
|
||||
mkdir -p $XDG_CONFIG_HOME/tmux/sessions
|
||||
sesdir=$XDG_CONFIG_HOME/tmux/sessions
|
||||
touch $sesdir/exists.session
|
||||
run $fut exists.session sessionname
|
||||
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue