RubyMine 5.4.0 Web Help

2.0+

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:

To enable shoulda support, follow these general steps
  1. Install shoulda gem to your project.
  2. 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"
            

See Also

Procedures:

Reference:

Web Resources: