ruby-on-railsunit-testingactiverecordtestunit

running Rails unit tests without loading the environment or using a database


As something of an academic exercise, I thought I'd try to get my unit tests running without loading the Rails env (or hitting the database).

I've seen this done before, and it seems like folks talk about it enough, but I can't find any good/current resources on getting it done.

Does anyone have any good stories or a nice long blog post about how to do this?


Solution

  • An useful link: testing Rails without Rails

    Testing without database would involve much mocks & stubs, nothing special to add.