I am using RSpe开发者_开发问答c, but Rails insists on generating Test::Unit tests. Maybe there is a configuration I missed?
if you are using rails 2 then you do:
ruby script/generate rspec_model Foo
using Rails 3 check out this example:
http://paulbarry.com/articles/2010/01/13/customizing-generators-in-rails-3
If you're using Rails 3, you need the rspec-rails integration gem from github: https://github.com/rspec/rspec-rails
The instructions are there on Github, but you will need to run
script/rails generate rspec:install
From the README:
"RSpec is registered with Rails as the test framework, so whenever you generate application components like models, controllers, etc, RSpec specs are generated instead of Test::Unit tests."
精彩评论