Reputation: 463
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
Upvotes: 2
Views: 983
Reputation: 146
Just type in your terminal(project root folder):
echo --require rails_helper > .rspec
Upvotes: 0
Reputation: 31
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.
Upvotes: 3