vim-runtest


Ⅰ. 插件描述

Runs Ruby specs from within Vim, supports the quickfix window to navigate failures

Ⅱ. 基本信息

创建日期:  2011-03-06
使用用户:  1
Github星:  5
插件作者:  Scott Bronson

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'bronson/vim-runtest'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'bronson/vim-runtest'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'bronson/vim-runtest'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# RunTest Vim Plugin

Run tests from within Vim and navigate to test failures using the quickfix window. Supports:

  • Ruby:

    [Rspec 3](https://github.com/rspec/rspeca),
    [RSpec 2](http://relishapp.com/rspec),
    [RSpec 1](http://rspec.info/),
    [MiniTest](https://github.com/seattlerb/minitest), and
    [Test::Unit](http://stdlib.rubyonrails.org/libdoc/test/unit/rdoc/classes/Test/Unit.html)
  • Perl: tbd
  • Python?

This was supposed to be a small plugin that shelled out to rspec/cucumber/etc
and presented its results in the quickfix window.

Unfortunately, vim's quickfix window has a horrible limitation: each error must be on a
a single line. This makes it next to impossible to follow a typical error and makes
navigating anywhere except the topmost function call really painful.
Until this is fixed I think this plugin, and all test runners like it, are dead ends.

One line per error might have been OK in the 90s but it's simply unusable these days.
I'm guessing skwp/vim-rspec's hack of using a regular buffer is the only reasonable way
to move forward.

Installation

Same as any other Vim plugin: use Pathogen and clone this repo into ~/.vim/bundle.

Usage

TODO: don't map these if the user has already mapped them.
TODO: integrate with vim-dispatch? at least allow it.

  • <Leader>t run closest test to the cursor
  • <Leader>T run all tests in current file
  • <Leader>r re-run the previous test run
  • <Leader>R run all possible tests

TODO: Very cool idea: https://github.com/reinh/vim-makegreen Can it be integrated with airline?

Alternatives

Running tests in vim has been dismal for years. So stupid that the
quickfix window can only show one line per error. Those backtraces
so critical to understanding what the test is doing? Gone.

Authors

添加新评论