Learnings for Week 33 2010

* If you want to test that that an exception is raised and then test the message that is easily accomplished with assert_raise:
exception = assert_raise ArgumentError do
  #something
end
assert_match /something/, exception.message
* If you're working on an older Rails project (pre Rails 2.1) you will be missing config.gem for Gem dependency management. If you have multiple versions of gems on the machine you can still load a specific version by using rubygems:
require 'rubygems'
gem 'RedCloth', '~>3.0'
* Rails doesn't check authenticity tokens on GET requests and doesn't ever check them in the functional tests. More info on Rails authenticity token here. As always be sure to check out the "other Rubinauts learnings":http://blog.rubinauts.com/?p=151. We've got some Asterisk stuff, talking about our builds a little and OS X server so take a look.
September 11, 2010 | programming, learnings, mail, git
About | Blog | Archives | Resume | RSS