Added spec helpers for ActiveRecord and non-Rails specs.