create custom_matchers.rb in application's spec directory, railsapp/spec.
custom_matchers.rb
module CustomMatcher def matcher_something #define custom matcher end end
edit railsapp/spec/spec_helper.rb
. . . require 'spec/rails' require File.dirname(__FILE__) + "/custom_matchers" ・ ・ Spec::Runner.configure do |config| . . config.fixture_path = RAILS_ROOT + '/spec/fixtures/' config.include(CustomMatcher)And matcher_someting is enabled.