1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 17:50:05 +08:00
SpaceVim/bundle/gina.vim/test/gina/custom/action.vimspec

48 lines
1.5 KiB
Plaintext

Describe gina#custom#action
Before all
let scheme = 'status'
let pattern = '/\%(branch\|tag\)'
End
After all
%bwipeout!
call gina#custom#clear()
End
Before
%bwipeout!
call gina#custom#clear()
End
Describe #alias({scheme}, {alias}, {origin})
It define an alias of {origin} to {alias} in a {scheme} buffer
call gina#custom#action#alias(scheme, 'doc', 'builtin:help')
GinaSync status
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'builtin:help \[doc\]')
Assert Match(result, 'builtin:help:all \[help:all\]')
GinaSync branch
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'No corresponding action')
GinaSync tag
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'No corresponding action')
End
It define an alias of {origin} to {alias} in buffers which match with /{pattern}
call gina#custom#action#alias(pattern, 'doc', 'builtin:help')
GinaSync status
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'No corresponding action')
GinaSync branch
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'builtin:help \[doc\]')
Assert Match(result, 'builtin:help:all \[help:all\]')
GinaSync tag
let result = execute('call gina#action#call(''doc'')')
Assert Match(result, 'builtin:help \[doc\]')
Assert Match(result, 'builtin:help:all \[help:all\]')
End
End
End