TestRSpec
RSpec plugin for Sublime Text 3
Details
Installs
- Total 5K
- Win 579
- Mac 3K
- Linux 886
| Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Linux | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime TestRSpec
RSpec plugin for Sublime Text 3.
Run, navigate and create specs from Sublime Text.

Installation
Using Package Control:
- Run “Package Control: Install Package” command, find and install
TestRspec. - Define key bindings (see Configuration section below).
- Restart Sublime Text.
Manually:
- Clone this repository into your packages folder (in Sublime Text: Preferences -> Browse Packages).
- Define key bindings (see Configuration section below).
- Restart Sublime Text.
Configuration
TestRSpec tries its best to autodetect how to run RSpec. However, you might need to make adjustments to plugin's configuration if you have an uncommon setup.
There are no key bindings enabled by default. Go to Preferences -> Package Settings -> TestRSpec -> Key Bindings to define key bindings.
Find settings in Preferences -> Package Settings -> TestRSpec.
Features
Run RSpec
Launch RSpec for:
- Current file
- Current line
- Rerun last run spec
Switch between code and spec
Jumps from code to spec and vice versa. If there multiple matches, it shows a list with matches.
Create a spec file
Creates a spec file when run in a source file.
Uses code snippet defined in settings (create_spec_snippet).
Copy last ran RSpec command
Copies the command of the last run spec. It can be useful e.g. when you want to debug your application within a 'real' terminal.
Tips
Ignore binding.pry when running specs
Sublime does not allow input in the output panel, so if you add binding.pry, tests get stuck
waiting on input.
To work around this, you can disable the debugger by modifying TestRSpec configuration:
{
"env": {
"DISABLE_PRY": "true"
}
}
Alternatively, use pry-remote.
Troubleshooting
Ruby not found or wrong ruby version used
Example error:
/usr/bin/env: ruby: No such file or directory
Override PATH variable in your shell configuration (~/.bashrc or ~/.bash_profile).
Make sure ruby command runs the right Ruby version in bash.
Alternatively, update package settings with path to ruby, e.g.:
{
"rspec_add_to_path": "$HOME/.rbenv/shims"
}
Spring is not used
Make sure you have both spring and spring-commands-rspec in your Gemfile.
If you use binstubs, you also need to run
bundle exec spring binstub rspec
Acknowledgments
Inspired by and uses code from https://github.com/maltize/sublime-text-2-ruby-tests
Contribution
Help is always welcome. Create an issue if you need help.
Copyright and license
Copyright © 2016 @astrauka
Licensed under the MIT license.