RSpec (snippets and syntax)
Textmate bundle for RSpec.
- Total 7K
- Win 840
- OS X 5K
- Linux 2K
|Aug 15||Aug 14||Aug 13||Aug 12||Aug 11||Aug 10||Aug 9||Aug 8||Aug 7||Aug 6||Aug 5||Aug 4||Aug 3||Aug 2||Aug 1||Jul 31||Jul 30||Jul 29||Jul 28||Jul 27||Jul 26||Jul 25||Jul 24||Jul 23||Jul 22||Jul 21||Jul 20||Jul 19||Jul 18||Jul 17||Jul 16||Jul 15||Jul 14||Jul 13||Jul 12||Jul 11||Jul 10||Jul 9||Jul 8||Jul 7||Jul 6||Jul 5||Jul 4||Jul 3||Jul 2|
RSpec TextMate Bundle
mkdir -p ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles git clone git://github.com/rspec/rspec-tmbundle.git RSpec.tmbundle osascript -e 'tell app "TextMate" to reload bundles'
Support for both RSpec-1 and RSpec-2
RSpec.tmbundle works with both rspec-1 and rspec-2. Given
that they work differently, the
RSpec.tmbundle tries its best to
figure out which one you're using in each project when you try to
run RSpec examples. There are two separate parts to this process,
and you have some control over how each one works.
RSpec.tmbundle prepares the
LOAD_PATH as follows:
Bundleris used to prepare the
Load Path with
requires 'bundler'and then
executed. (This can be overridden - see below).
Bundlerisn't being used,
vendor/gemsare searched for
rspecis found, then
libdirectory is added to
LOAD_PATH is prepared,
RSpec-tmbundle tries to
determine which version of RSpec to use as follows:
RSpec-tmbundlechecks for an
./rspec-tmfile in the project's root directory. If that file is exists, then
RSpec-tmbundleattempts to set the RSpec version from the configuration found there.
To configure the version using this method add a file named
.rspec-tm to the project's root directory containing:
or whichever version you are using.
This is the one foolproof way to ensure that the right version is
invoked, but you don't really need to do this in most cases.
If no version is configured,
RSpec-tmbundledetermines the version to
use based on the files present there.
If no version is configured and no rspec directory could be
found in vendor, then
RSpec-tmbundleattempts to run rspec-2
If that raises an exception,
RSpec-tmbundle makes a final
attempt by trying to run rspec-1 with:
Which Approach Should I Use?
The effectiveness of each approach is partially dependent on how
you manage your gem environment. The simplest (and suggested)
approach is to first just see if it just works, and if not, then
configure the version you want in the
The RSpec TextMate bundle does not
require "rubygems" so that
users who choose other packaging mechanisms can still use it. If
you are using Rubygems as your package manager, then the
simplest thing to do is
- open the TextMate Preferences
- go to the
- add a variable named
RUBYOPTwith the value
You can set the following options in an
.rspec-tm file in the
root directory of your project:
see RSpec-version, above.
Bundler, even if there is no
Gemfile (in which case you
should have the
BUNDLER_GEMFILE environment variable set).
Bundler, even if there is a
TextMate shell variables
In addition to the standard TextMate shell variables, the RSpec
TextMate bundle supports the following:
Set a custom formatter other than RSpec's TextMate formatter. Use
the full classname, e.g.
Use this to set RSpec options just as you would in an
If you're hacking on rspec yourself, point this to the
rspec-core project directory for rspec-2, or the
directory for rspec-1.
There are lots of ways to configure TextMate to work with
but this is the one the we recommend:
With rvm installed, take the full path to
Next, set up a
TM_RUBY option in
TextMate/Preferences/Advanced/Shell Variables that points to the
Learn more at:
RSpec.tmbundle are based on Florian Weber's TDDMate.
The license of
RSpec.tmbundle is the same as