'Rails how to configure rspec so you do not need to require "rails_helper"

title says it all mostly. Given new Rails app and rspec-rails. If I app an app/lib/foo.rb class. How do I configure rspec to be loaded so I do not have to do this:

# spec/lib/foo_spec.rb
require "rails_helper"

describe Foo do
end


Solution 1:[1]

In the .rspec file at the root of the project, add

--require rspec_helper

on its own line. The rspec command adds any options in this file automatically when run.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SJTalbutt