Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rspec_vim_formatter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspec_vim_formatter

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RspecVimFormatter

Allow rspec to output in a format that VIM's quickfix understands:

app/controllers/people_controller.rb:5: GET /peopleworks! (now write some real specs): Could not find table 'people'

Installation

I recommend that you install this as a global gem, since choice of editor is a personal preference.

$ gem install rspec_vim_formatter

Usage

Simple Usage

bundle exec rspec --format RspecVimFormatter --out quickfix.out --format progress

Like a Baus

" ~/.vimrc

" install thoughtbot's `vim-rspec`
Bundle 'thoughtbot/vim-rspec'

" vim-rspec mappings
nnoremap <Leader>t :call RunCurrentSpecFile()<CR>
nnoremap <Leader>specn :call RunNearestSpec()<CR>
nnoremap <Leader>spec :call RunLastSpec()<CR>
nnoremap <Leader>a :call RunAllSpecs()<CR>

" <leader>k to open the spec output in quickfix
map <leader>k :cg quickfix.out \| cw<cr>

" dump the spec running command into a fifo
let rspec_command = "bundle exec rspec {spec}"
let rspec_options = " --format RspecVimFormatter --out quickfix.out --format progress"
let g:rspec_command = "echom system('echo \"" . rspec_command . rspec_options . "\" >> ~/.wrench')"
# run the commands from the fifo in a loop
mkfifo ~/.wrench
while true; do cmd=`cat ~/.wrench`; clear; date +%s; echo "$cmd"; sh -c "$cmd"; done

Now you can <leader>t, to run the current spec asynchronously, and <leader>k to quickly jump to the failure!

rspec_vim_formatter

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 06 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc