Rspec Config
You've included rspec in your Gemfile, run bundle install and you want to initialize some examples to start testing.
> rails g rspec:install
The thing is you are sick of all the extras that come along with the rails/rspec generators. You don't want views, helpers, javascript files, etc.
Quickie
All you need to do is add some light configuration options. Open config/application.rb:
> vim config/application.rb
Now, inside of the Application class, enter the following configuration options by passing a block into config.generators:
config.generators do |g|
g.test_framework :rspec, fixture: false
g.view_specs false
g.helper_specs false
g.stylesheets = false
g.javascripts = false
g.helper = false
end
As you can see, we have established our test framework, disabled fixtures, view specs, helper specs, stylesheets, javascripts, and helper. Now, when you generate your next controller, model, or resource you wont get a bunch of pesky files that you'll just end up having to delete!
ƪ(˘⌣˘)ʃ
Leave Rspec Config to:
Read more #ruby posts
Best Posts From davidpm
We have not curated any of davidpm's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From davidpm
- Disabling dangerous redis commands in Production redux
- Heuristics on the Practice of Programming
- Git Interactive Rebase to Alter Commits
- Dropping Into B-trees
- Create a command-line gem from scratch with Thor (part two)
- Create a command-line gem from scratch with Thor
- Blockchain Proof of Concept
- SQL Cheat Sheet
- Bootstrap with Rails and Postgres
- REGEX Multiline Anchors
- Rspec Config
- Rails MIME Types
- Messages with Methods in Ruby
- CPUs