fisher/test/key-bindings-disable.fish
Jorge Bucaran 3308240929
Make __fisher_key_bindings_undo smarter. Close #121.
Until now key_bindings.fish only allowed simple bind <args>
staments and would fail for conditional statements, etc.
2016-02-25 10:08:48 +09:00

35 lines
902 B
Fish

set -l path $DIRNAME/.t-$TESTNAME-(random)
set -l fixtures $DIRNAME/fixtures/key-bindings
function -S setup
mkdir -p $path
cp $DIRNAME/fixtures/key-bindings/*.fish $path
set -g fisher_binds $path/fisher_key_bindings.fish
function bind
printf "%s\n" "bind $argv"
end
for plugin in foo bar baz
__fisher_key_bindings_disable $plugin $path/user_key_bindings.fish >> $path/key_bindings_log
end
end
function -S teardown
rm -rf $path
functions -e bind
end
test "$TESTNAME - Remove bindings from fisher key bindings file"
! -s $path/fisher_key_bindings.fish
end
test "$TESTNAME - Update fish_user_key_bindings after all bindings are deleted"
(cat $fixtures/expected/key_bindings) = (cat $path/user_key_bindings.fish)
end
test "$TESTNAME - Undo plugin bindings"
(cat $fixtures/expected/key_bindings_log) = (cat $path/key_bindings_log)
end