TESTING
889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Testing
==============
Tests are written with the standard Rails setup of Test::Unit and run using rake.
Setup
=======
Create a new Rails app, and add acts_as_follower as a plugin.
By default the tests database uses in-memory sqlite. This requires the appropriate library:
sudo gem install sqlite3-ruby
If you wish to use mysql instead, create a database as specified in test/database.yml.
Running
=======
From the command line, within the acts_as_follower directory:
rake test # For sqlite
or:
DB=mysql rake test # For mysql
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.