From 8f9ffd4d54e3da528451bc02ad763235efa09266 Mon Sep 17 00:00:00 2001 From: Stefan Daschek Date: Tue, 19 Aug 2014 22:45:54 +0200 Subject: [PATCH] Update readme. --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a40c9a17..0c5d667c7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,20 @@ Open up TextMate’s preferences, go to “Bundles” and make sure “RSpec” ## Running RSpec examples -__Summary:__ If your project has a binstub (`bin/rspec`), make sure you’ve customized TextMate’s `$PATH` to play nicely with your Ruby version manager ([rbenv](https://github.com/sstephenson/rbenv), [rvm](http://rvm.io/), …). If it has a `Gemfile`, the same goes for `$TM_RUBY`. If you’re using the Ruby bundled with Mac OS, you shouldn’t need to customize anything. +Commands for running examples: + + * __Run Examples__ ⌘R: Run all examples in the current spec file. + * __Run Single Example__ ⇧⌘R: Run the example on the current line (also works for example groups). + * __Run Examples in Selected Files/Directories__ ⌥⇧⌘R: Run all examples from the files / directories selected in the file browser. If nothing is selected, run all examples in `spec/`. Hint: ⇧⌘A ⌥⇧⌘R is a quick way to run all specs (⇧⌘A deselects everything in the file browser). + * __Run Again__ ⌥⌘R: Repeat the last run command (can be example file, single example or examples in selected files). + +If your project has an `.rspec` file in its root, the last two commands – “Run Examples in Selected Files/Directories” and “Run Again” – are available everywhere in your project (even in files that not using the “RSpec” mode). + +## Configuring TextMate for running examples + +Using the bundle to run commands means that RSpec is run from a TextMate subprocess. Some caveats apply: + +__TL;DR:__ If your project has a binstub (`bin/rspec`), make sure you’ve customized TextMate’s `$PATH` to play nicely with your Ruby version manager ([rbenv](https://github.com/sstephenson/rbenv), [rvm](http://rvm.io/), …). If it has a `Gemfile`, the same goes for `$TM_RUBY`. If you’re using the Ruby bundled with Mac OS (not recommended), you shouldn’t need to customize anything. Now here come the gritty details. There are two ways the bundle can run RSpec: