Giter Club home page Giter Club logo

vim-rspec's Introduction

Vim with Rspec

INSTALL
-------
This plugin make easy to run the spec command inside Vim. You need Hpricot (http://wiki.github.com/why/hpricot) 
OR xsltproc (http://www.xmlsoft.org/XSLT/xsltproc2.html) and grep (http://www.gnu.org/software/grep) to use it.
Hpricot takes precedence over xsltproc. 
There are four files on the package: the Vim script, the Ruby script, the XSL file and the syntax file.

To install, unpack the files on your ~/.vim directory and source it to make it available. You
can also use the Makefile to install the files, just type:
make install

USAGE
-----
There are three commands available: 

You can run RunSpec and spec will run with the current spec under the cursor (if it's in a *_spec.rb file).
You can run RunSpec and spec will run with the current file (if it's a *_spec.rb file). 
You can run RunSpecs and spec will run with all the files inside the spec directory. 

After some of the commands above runs, it will open a new window with the result, where you can click on the error 
lines where there's a file path with the line number (press <CR>) and it will open on a new window, moving the cursor to the 
line where the error is.

NOTE
----
Once you have run a spec, you can re-run it with the same command (key mapping) while you are working with 
your source rb files without switching back to the spec file.

Of course, you can create some mappings to make easier to call the commands.

Here are my key mappings in .vimrc file:

"	RunSpec: <command-x|y|z>
nmap	<d-x>	:RunSpec<cr>
nmap	<d-y>	:RunSpecFile<cr>
nmap	<d-z>	:RunSpecDir<cr>

Pulled changes made by brentmc79 (https://github.com/brentmc79/vim-rspec.git, 8362017a11d6b1d77966), and some note:

This fork of the plugin plays nice with Rails 3 and Bundler. If you've declared the g:RspecBundlerExec var in your
.vimrc file, then specs are run with your app's gem bundle via the "bundle exec" command.  To disable this, remove 
the g:RspecBundlerExec declaration from you .vimrc file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.