Tuesday, October 26, 2010

Rspec and Generators

I learned a new trick today!

When working in Rails, I use the generators as easy ways to create models with migrations, and whatnot. I got used to running my generators with "--rspec" since that's the test framework I'm using currently.

I can save myself some time by adding this to my application.rb:

config.generators do |g|
g.test_framework :rspec

Simple, right? But it sure saves me from forgetting and having to hand-make my own spec files. (It's the little things...)

No comments:

Post a Comment