Living on the Edge

As a Rails developer I am still a bit wet behind the ears. Following the lead of a more senior developer I picked up the habit of developing all(that is four so far) applications in Rails Edge with the help of RSpec, Edge RSpec.

Last weekend I picked up a pet project which a colleague and I came up with. Nothing difficult and we figured we could get this done within the week. Boy was I wrong. Setting the whole thing up took me the better part of the day. Of course partially due to my own inexperience but the fact that I was using Edge for everything didn’t help.

I’ll skip all the things which went horribly wrong, this is what I _should_ have done:


$ rails new_prj
$ cd new_prj
$ piston import http://dev.rubyonrails.org/svn/rails/trunk vendor/rails
$ piston import svn://rubyforge.org/var/svn/rspec/trunk/rspec vendor/plugins/rspec
$ piston import svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails vendor/plugins/rspec_on_rails
$ ./script/generate rspec

Don’t try to freeze rails using rake rails:freeze:edge. This leads to pain and the absence of a framework dependency causing the ./script/server command to fail.
Don’t try to use the current release of RSpec in combination with the edge version of Rails. This again leads to suffering and mysteriously failing tests.
Don’t forget that running ./script/generate rspec_model is not enough to get the entire RSpec framework to behave. It’ll work to some degree but has some crucial functionality missing. For example the ./script/spec command is missing.
Don’t expect Restful authentication to play nice with RSpec through Vaporbase’s spec files. Don’t get me wrong the guys of Vaporbase did a great job it just didn’t work for me. The class UserNotifier should be UserMailer in my instance and the protected helper methods in the sessions_controller_spec.rb are ran by rspec throwing weird errors. So these should be moved to the spec_helper.rb file.

As a final bonus, ever wanted to spec a single file?


$ ./script/spec spec/controllers/foo_controller_spec.rb --color -b

Leave a Reply