vim-mocha


Ⅰ. 插件描述

Run mocha specs from vim

Ⅱ. 基本信息

创建日期:  2013-10-22
使用用户:  33
Github星:  20
插件作者:  Nicholas Hwang

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/geekjuice/vim-mocha

Ⅳ. 文档说明

# vim-mocha

This is a lightweight Mocha runner for Vim. Extracted from
vim-spec

Based off of Attamusc/vim-mocha and
subsequently thoughtbot/vim-rspec.

Use both RSpec and Mocha? Take a look at vim-spec!

Installation

Using vundle:

Bundle 'geekjuice/vim-mocha'

If using zsh on OS X it may be necessary to run move /etc/zshenv to /etc/zshrc.

Using pathogen

cd ~/.vim/bundle
git clone git://github.com/geekjuice/vim-spec.git

Using vim-plug

Plug 'geekjuice/vim-mocha'

Example of key mappings

__NOTE__: The mappings have changed and use the same mappings as vim-rspec and
vim-spec. If this is a big issue for you, open an issue and I'll re-add/add the
namespace.

map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

Configuration

Like thoughtbot/vim-rspec, the
following variables can be overwritten for custom spec commands:

  • g:mocha_js_command
  • g:mocha_coffee_command

Examples:

let g:mocha_js_command = "!mocha --recursive --no-colors {spec}"
let g:mocha_coffee_command = "!mocha -b --compilers coffee:coffee-script{spec}"

" Using test runners
let g:mocha_coffee_command = "!cortado {spec}"

Note: cortado is a sugar wrapper for a more complex mocha call.

Notes

  • Allow configuration for mocha options i.e. --recursive, --reporter dot
  • __BUG__: Last nearest test fails if below it call

Credits

thoughtbot/vim-rspec

Attamusc/vim-mocha

License

mocha.vim is released under the MIT License.

添加新评论