swanandp/acts_as_list — pull request #24 by splattael (2011-11-16 15:15:46+00:00)
Title: Massive test rafactorings.

According to `flay` there was much duplication in test code. This isn't bad by default but it makes `test_list.rb` almost unreadable. At least for me.

With `test/unit` you can split up duplicate test code into modules. This killed many lines:

### Before

* test lines: `1355`
* flay score: `6268`
* rake: `71 tests, 439 assertions, 0 failures, 0 errors`

### After

* test lines: `816`
* flay score: `2272`
* rake: `71 tests, 439 assertions, 0 failures, 0 errors`

### Future

`flay` still reports similiar code which can be refactored easily but I am not sure if you accept that huge pull request ;)

$ flay test/ | less
Total score (lower is better) = 2272

1) Similar code found in :defn (mass = 720)
test/shared_list_sub.rb:7
test/shared_list.rb:7
test/shared_zero_based.rb:29
test/shared_array_scope_list.rb:7

2) Similar code found in :defn (mass = 354)
test/shared_list_sub.rb:83
test/shared_list.rb:105
test/shared_array_scope_list.rb:105

3) Similar code found in :defn (mass = 252)
test/shared_list.rb:70
test/shared_zero_based.rb:51

4) Similar code found in :defn (mass = 196)
test/shared_list.rb:48
test/shared_zero_based.rb:7

5) Similar code found in :defn (mass = 172)
test/shared_list.rb:143
test/shared_array_scope_list.rb:130

6) Similar code found in :defn (mass = 164)
test/shared_list.rb:156
test/shared_array_scope_list.rb:143

7) Similar code found in :defn (mass = 150)
test/shared_list_sub.rb:29
test/shared_list.rb:29
test/shared_array_scope_list.rb:29

8) Similar code found in :defn (mass = 132)
test/shared_list_sub.rb:35
test/shared_list.rb:35
test/shared_array_scope_list.rb:35

Please follow each commit if the result (Files Changed) is overwhelming.

If you have questions please drop a line :)