Giter VIP home page Giter VIP logo

vim-rspec's Introduction

vim-rspec

Beautiful, colorized RSpec tests in Vim with direct access to the line where the error occurred.

GreenScreenshot

HISTORY

INSTALL

  • Requires: gem install hpricot
  • Install with pathogen: clone/submodule into vim/bundle

USAGE

  • :RunSpec for current file
  • :RunSpecLine for current line (current 'it' block)
  • :RunSpecs for all files in spec dir
  • A split will open vertically on the right (if you prefer vertical, let g:RspecSplitHorizontal=0)
  • You can hit 'n' to go to the next error, or navigate to it and hit Enter to go to the line in the file.

Enhancements by @skwp (Yan Pritzker)

  • Run rspec on current line (execute a single 'it' block)
  • Failures and Success is now displayed prominently at the top in green or red
  • Improved colors (for Solarized, specifically)
  • Run in same window, do not create a new window for every run
  • When browsing errors in rspec window, hitting enter takes you to the code in other split (do not create new window)
  • Ability to hit 'n' in the rspec output to go to the next error (and the corresponding code in the split)
  • Unescape html so that brackets in stacktraces are correctly displayed
  • Took out xslt support to focus the project on a ruby-based formatter
  • Default to horizontal split, use "let g:RspecSplitHorizontal=0" in vimrc to split vertical

Suggested Key Mappings

By default you get these keymappings. If you don't want them, turn them off with:

let g:RspecKeymap=0

Run using Cmd-Shift-R:

map <D-R> :RunSpec<cr>

Run on current line (current 'it' block) Cmd-Shift-L:

map <D-L> :RunSpecLine<cr>

TODO

  • Further refactoring to improve maintainability
  • Support for rspec2 (longer term, as I currently don't use it myself)
  • Custom paths for RunSpecs (e.g. fast_specs dir)
  • Support for other testing frameworks (test/unit, shoulda), maybe

NOTE: This version is drastically different from the original taq/vim-rspec fork due to a large refactoring of the main codebase into a modularized form. If you have an old fork with custom changes, you may want to look at what's been done here.

vim-rspec's People

Contributors

skwp avatar taq avatar vlmonk avatar justinlove avatar jonuts avatar

Stargazers

Angus H. avatar Julien Blanchard avatar

Watchers

Julien Blanchard avatar James Cloos avatar  avatar

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.