RubyMine helps you write Shoulda tests on attaching the shoulda gem.
Note
RubyMine provides Shoulda-specific code completion, if one of the following conditions is observed:
- The Bundler is used.
- For Rails 2.*, Shoulda is specified in environment.rb
- For the Ruby projects, require 'shoulda' is mandatory.
Refer to Shoulda installation
page to learn about using Shoulda in Rails applications.
Having enabled Shoulda support in your project, you can:
- Use Shoulda-aware code completion for the contexts and should blocks:

Click thumbnail to view larger image. - Run and debug Shoulda tests using the Test::Unit run/debug configuration,
or a user-defined Rake task. In both cases, RubyMine will run tests in the test runner UI.
So doing, you can launch test cases, should blocks, or all test cases in a directory.
- View Shoulda tests in the File Structure view:

Click thumbnail to view larger image. - In the Rails applications, view Shoulda tests in the Test::Unit/Shoulda node of
the Rails view:

Click thumbnail to view larger image.
- Install shoulda gem to your project.
-
Mark as test roots the directories with the Shoulda tests.
Example
Consider creating a Shoulda test in a Ruby project. Create a Test::Unit test template.
Note that you can also create a plain Ruby script. In this case, make sure that its name ends with
_test.rb.
In an empty Ruby project, add the following statements to the Test::Unit test cases with Shoulda tests:
require "test/unit"
require "rubygems"
gem "shoulda"
require "shoulda"