I am writing a Rails 3.1 engine and testing with RSpec 2. When I use rails generate , I automatically get the specification files for me, which is so convenient:
$ rails g model Foo invoke active_record create db/migrate/20111102042931_create_myengine_foos.rb create app/models/myengine/foo.rb invoke rspec create spec/models/myengine/foo_spec.rb
However, in order for the generated specs to play well with my isolated namespace, I have to manually wrap the spec every time in the module:
require 'spec_helper' module MyEngine describe Foo do it "should be round" ... end end
I would really like to know if there is a simple and easy way to modify automatically generated specification templates, so I donβt need to wrap the specification in Module MyEngine every time I create a new model or controller.
source share