How to test ActiveRecord witout Rails?
问题 I have a project in which I use ActiveRecord to store information in a sqlite db file. I'm not using Rails and AR seems to do the job perfectly. My question is how exactly to test my classes witout hitting the db? I found some gems that would to the trick (FactoryGirl, UnitRecord), but they are meant to work with Rails. class News < ActiveRecord::Base belongs_to :feed def delete_old_news_if_necessary # time_limit = Settings::time_limit return if time_limit.zero? News.destroy_all("date < #