Global Setup In RSpec or How To Add Logging For Specs
Brian Morearty had an interesting post on how to add additional information to a rails testing log when using Test::Unit. The benefit of this is that you can quickly scan your log file when a test fails and see clues on why it failed. If you’re using RSpec you can add the same functionality all within the confines of the RSpec API for both specs (examples) and the story runner.
Global Setup for
Writing Macros in RSpec
Thoughtbot put up a good post about creating “macro”s with Shoulda . Shoulda has some very nice built-in macros which help a lot in keeping tests DRY without sacrificing the documentation aspect of tests. (In fact I think these improve the readability of most tests because it removes some of the noise.) As Tammer Saleh said in the post these “macros” are nothing more than normal class methods, and so you
