A small Sublime Text package to boost your productivity when using Minitest.
- provides command and shortcut for toggling between implementation/test files
The default binding for toggling is super+;
{
"keys": ["super+;"],
"command": "minitest_toggle"
}
You can change it to whatever you want by adding the following snippet to your Keybindings file.
{
"keys": ["ctrl+alt+down"],
"command": "minitest_toggle"
}
Ps: super
is command on mac
- Open the Command Palette (Super+Shift+p) and choose “Install Package”
- Select “Minitest Buddy” and press Enter
- Change to your Sublime Text
Packages
directory - Clone repository
git clone https://github.com/glaucocustodio/minitest-buddy-for-sublime-text.git 'Minitest Buddy'
project/
- foo.rb
test/
- test_foo.rb
Once the toggle command is hit this package will figure whether or not the current file is a test or a implementation file. This is done by checking if the file name starts with test_
.
If it is a implementation file (foo.rb
), the package will look for any test_foo.rb
inside the test
directory.
If it is a test file (test_foo.rb
), the package will look for any foo.rb
inside the project
directory.
If more than one file is found, a quick panel will appear so you can choose the one you want to open.
The gem is available as open source under the terms of the MIT License.