tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

[Feature Update] Have :Rake run Rspec through the rspec command instead of through rake #76

Closed jackkinsella closed 13 years ago

jackkinsella commented 13 years ago

Currently calling :Rake on an rspec file runs the file through rake. It could be improved by running it through rspec.

The reasoning here is that running through spec (e.g. rspec spec models/user_spec.rb) can make use of a DRB server via Spork and so can run in 0.2 seconds as opposed to 2 seconds as it currently does. This is a huge increase in productivity when doing TDD.

graywh commented 13 years ago

There's nothing to stop you from making your own command that does what you want. In my opinion, it seem counter-intuitive for :Rake to not use rake.

jackkinsella commented 13 years ago

I don't think it's counter-intuitive since the command "Rake" in the Rails world is synonymous with "test". For example if you type "rake" alone into any rails application it will run it's suite of tests.

Perhaps a new command could be created :R to run either rpsec or rake?

With Bundler and Rspec 2 people don't run their specs through Rake anymore so there is a good argument for updating.

graywh commented 13 years ago

:R already has a function.

Also, you have to determine which of these is correct: "spec", "rspec", "bundle exec spec", "bundle exec rspec"

And remember that there are reasons for using "rake spec"; primarily db:test:prepare.

tpope commented 13 years ago

Yeah, I have to side with ":Rake should run rake." I've thought about adding :Run or something to address this use case, but as graywh points out, it raises a bunch of questions.