fiveruns / data_fabric

Sharding support for ActiveRecord 2.x

This URL has Read+Write access

mperham (author)
Mon Dec 01 18:33:58 -0800 2008
commit  ab0ca84c76e4fb7ca72d3555e142a269e154bf74
tree    7bec85cf3f601157c97da1be6c0b1123a7343c52
parent  2a953c3674754525da9bb4176527a9ff500b7c23
data_fabric / TESTING.rdoc
100644 31 lines (19 sloc) 1.161 kb

data_fabric has two layers of tests: unit tests and integration tests.

Running the Unit Tests

The unit tests test both with and without an actual database. test/database_test.rb tests against a database. The other unit tests mock AR so no actual database is required. You can use the standard test/database.yml which tests against SQLite3 or customize the provided test/database.yml.mysql. The "rake create_db" task will set up the necessary databases and tables.

Running the Integration Tests

data_fabric ships with an example application which shows an actual Rails application using data_fabric. You can customize config/database.yml but by default it uses a local Sqlite3 database so there should be no customization necessary.

Run the Rake task to prepare the application for testing. This will copy the latest data_fabric code to vendor/plugins, delete existing databases and migrate all the databases from scratch. You should then be able to run the example application’s tests.

 cd example
 rake app:prepare
 rake test

Submitting Bugs

If you think you’ve found a problem with data_fabric, contact me at mperham AT gmail.com.