Creating Test Templates
The most basic way to create test templates is to use the regular procedure of creating files in project. This means is available for both plain Ruby projects, and for the Rails applications, and allows creating stub tests for Test::Unit, RSpec and Test-Spec.
For RSpec and Test-Spec RubyMine provides a number of generators. These generators are
context-sensitive, and become available depending on the selected location, and on the gems activated for
your project. For example, if
rspec-rails is activated, the usual generators are
hidden, and the list of generators includes only those specific for RSpec.
To create a test template, follow these general steps
- Select the target location in the Project tool window.
- Press Alt+Insert.
- In the New pop-up menu, select the desired test template:
- For an RSpec or Test-Spec test templates, specify the names for the test file, behavior, and "should". For a TestUnit test template, specify the name for the file and test case.