Ⅰ. 插件描述
vim plugin to run ruby tests using https://github.com/benmills/vimuxⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'pgr0ss/vimux-ruby-test'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'pgr0ss/vimux-ruby-test'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'pgr0ss/vimux-ruby-test'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/pgr0ss/vimux-ruby-test
Ⅳ. 文档说明
WHAT?
- Run the test/spec your cursor is currently on
- Run the context your cursor is currently in
- Run the entire test/spec you are working in
- Streaming output to tmux via vimux
This plugin currently supports
- test/unit
- dust
- rspec
- shoulda
HOW?
Use any of the commands below. Map them to shortcuts
in your .vimrc for easy access.
- RunRubyFocusedTest - run focused test/spec
- RunRailsFocusedTest - run focused test (no spec support) in a Rails app
- RunRubyFocusedContext - run current context (rspec, shoulda)
- RunAllRubyTests - run all the tests/specs in the current file
You can also use the following settings in .vimrc to configure the command used to run ruby tests:
let g:vimux_ruby_cmd_unit_test = "bundle exec ruby"
let g:vimux_ruby_cmd_all_tests = "testdrb"
let g:vimux_ruby_cmd_context = "FOO=bar ruby"By default, vim-ruby-test clears the tmux pane in which the command is run. You can configure
this behavior:
let g:vimux_ruby_clear_console_on_run = 0By default, vim-ruby-test uses the absolute path for file arguments. You can configure it to instead use relative paths with:
let g:vimux_ruby_file_relative_paths = 1INSTALL
Put the contents of this directory into your pathogen bundle. That's it!
REQUIREMENTS
- vim with ruby support (compiled +ruby)
- vimux >= 0.3.0