Coder Social home page Coder Social logo

vim-rspec-1's Introduction

rspec.vim

This is a lightweight RSpec runner for Vim and MacVim.

Installation

Recommended installation with vundle:

Bundle 'thoughtbot/vim-rspec'

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

Configuration

Key mappings

Add your preferred key mappings to your .vimrc file.

" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

Custom command

Overwrite the g:rspec_command variable to execute a custom command.

Example:

let g:rspec_command = "!rspec --drb {spec}"

This g:rspec_command variable can be used to support any number of test runners or pre-loaders. For example, to use Dispatch:

let g:rspec_command = "Dispatch rspec {spec}"

Or, Dispatch and Zeus together:

let g:rspec_command = "compiler rspec | set makeprg=zeus | Make rspec {spec}"

Custom runners

Overwrite the g:rspec_runner variable to set a custom launch script. At the moment there are two MacVim-specific runners, i.e. os_x_terminal and os_x_iterm. The default is os_x_terminal, but you can set this to anything you want, provided you include the appropriate script inside the plugin's bin/ directory.

iTerm instead of Terminal

If you use iTerm, you can set g:rspec_runner to use the included iterm launching script. This will run the specs in the last session of the current terminal.

let g:rspec_runner = "os_x_iterm"

Credits

thoughtbot

rspec.vim is maintained by thoughtbot, inc and contributors like you. Thank you!

It was strongly influenced by Gary Bernhardt's Destroy All Software screencasts.

License

rspec.vim is copyright © 2014 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.

The names and logos for thoughtbot are trademarks of thoughtbot, inc.

vim-rspec-1's People

Contributors

calebhearth avatar jferris avatar jklina avatar alexgenco avatar declank avatar derekprior avatar sobrinho avatar harlow avatar ilyakatz avatar jamesaanderson avatar jessieay avatar mohanzhang avatar raykrueger avatar

Watchers

RocknrollMarc 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.