Did you know you can use a memory-based database to run your Rails tests? Compared to running tests against a regular database (PostgreSQL, MySQL, or SQLite), it’s much, much faster.

You’ll need SQLite (http://www.sqlite.org/, http://wiki.rubyonrails.org/rails/pages/HowtoUseSQLite) and the MemoryTestFix plugin (http://topfunky.net/svn/plugins/memory_test_fix/) from Geoffrey Grosenbach.

The instructions given are great, except if you use SQLite3, like me. If you do, you’ll need to make a small tweak to the memory_test_fix.rb file. On line 4, Simply change SQLiteAdapter to SQLite3Adapter. That’s it! Enjoy faster tests!

Linkage


Sorry, comments are closed for this article.