I recently found squirrel, and I wanted to use it for a project we’re working on to simplify some complex finder statements. Squirrel allows turning something like this:
Task.find(:all, :conditions => [ 'active = ? and (updated_at > cache_version or cache_version IS NULL)', true ] )
into:
Task.find(:all) do active == true any do updated_at > cache_version cache_version.nil? end end
The problem is testing
Then I ran into a serious problem – how to test this piece of code using rspec? Here was my first attempt: more »
