TESTING 1.15 KB
Testing
==============

Tests are written with Shoulda on top of Test::Unit and Factory Girl is used instead of fixtures.  Tests are run using rake.
Test can either be run against a MySQL database or the faster in-memory SQLite3.


MySQL
=======

1. Create a new Rails app.
2. Install acts_as_follower as a plugin.
3. Copy the database config within the plugin:
    cp test/database.yml.example test/database.yml
4. Create a database as specified in test/database.yml.
5. Run the tests:
    rake test


SQLite3
=======

1. Create a new Rails app.
2. Install acts_as_follower as a plugin.
3. Copy the database config within the plugin:
    cp test/database.yml.example test/database.yml
4. Install the sqlite3 library (if you don't have it already):
    sudo gem install sqlite3-ruby
5. Run the tests:
    DB=sqlite3 rake test


Coverage
=======

Test coverage can be calculated using Rcov. Make sure you have the rcov gem installed.

Again in the acts_as_follower directory:

rake rcov:gen   # For mysql

or:

rake rcov:gen DB=sqlite3   # For sqlite

The coverage will now be available in the test/coverage directory.

rake rcov:clobber will delete the coverage directory.