TESTING 1.11 KB
Testing
==============

Tests are written with the standard Rails setup of Test::Unit and 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 sqlite

or:

DB=mysql rake rcov:gen   # For mysql

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

rake rcov:clobber will delete the coverage directory.