kana / vim-vspec

Vim plugin: Testing framework for Vim script
http://www.vim.org/scripts/script.php?script_id=3012
222 stars 13 forks source link

plugin/project.vim not automatically invoked #24

Closed davidhalter closed 11 years ago

davidhalter commented 11 years ago

For jedi-vim I'm implementing some kind of testing. Because of it's Python nature, I wanted to lower dependencies and came up with this py.test script: https://github.com/davidhalter/jedi-vim/blob/dev/conftest.py

The only important thing that it does is actually invoking vspec like this:

vspec-folder/bin/vspec vspec-folder . test/goto.vim

Where test/goto.vim is this file: https://github.com/davidhalter/jedi-vim/blob/dev/test/goto.vim

Testing autoload files works fine, but using plugins, doesn't. Therefore I had to add

source plugin/jedi.vim

That's of course possible, but a little bit annoying. Is this intentional? Or did I call vspec the wrong way? IMHO vspec should automatically source plugin files, without me sourcing them.

Thanks for your work! It really seems to be a nice project for testing vim scripts.

davidhalter commented 11 years ago

I see now at least one reason why this might make sense: If I want to modify certain configuration variables of the plugin, it's much easier to source it afterwards.

kana commented 11 years ago

I see now at least one reason why this might make sense: If I want to modify certain configuration variables of the plugin, it's much easier to source it afterwards.

That's right. Additionally, several plugins which define key mappings for useful functions try not to override key mappings defined by users. If plugin/*.vim are automatically :source'd, we have to provide a way to emulate user's vimrc to reproduce such situations. It makes things complicated.

Therefore I prefer writing :source explicitly.