| 1 |
source plugin/jedi.vim |
| 2 |
|
| 3 |
describe 'documentation docstrings' |
| 4 |
before |
| 5 |
set filetype=python |
| 6 |
end |
| 7 |
|
| 8 |
after |
| 9 |
try | %bwipeout! | catch | endtry |
| 10 |
end |
| 11 |
|
| 12 |
it 'simple' |
| 13 |
Expect maparg('K') == ':call jedi#show_documentation()<CR>' |
| 14 |
put = 'ImportError' |
| 15 |
normal GK |
| 16 |
Expect bufname('%') == "__doc__" |
| 17 |
Expect &filetype == 'rst' |
| 18 |
let header = getline(1, 2) |
| 19 |
Expect header[0] == "Docstring for class builtins.ImportError" |
| 20 |
Expect header[1] == "========================================" |
| 21 |
let content = join(getline(3, '$'), "\n") |
| 22 |
Expect stridx(content, "Import can't find module") > 0 |
| 23 |
normal K |
| 24 |
Expect bufname('%') == '' |
| 25 |
end |
| 26 |
|
| 27 |
it 'no documentation' |
| 28 |
put = 'x = 2' |
| 29 |
normal o<ESC>GK |
| 30 |
Expect bufname('%') == '' |
| 31 |
end |
| 32 |
end |
| 33 |
|
| 34 |
" vim: et:ts=4:sw=4 |