cirandas.net

ref: master

lib/tasks/test_smells.rake


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def find_test_smells(id, title, pattern)
  full_id = 'test:smells:' + id
  task full_id do
    system("
      (
        echo '########################################################'
        echo '# #{title}'
        echo '########################################################'
        echo
        ack-grep --group --color '#{pattern}' test/unit/ test/functional/ test/integration/
      ) | less -R
    ")
  end
  task 'test:smells' => full_id
end

find_test_smells 'dbhits', "Full database hits (they are probably unecessary)", '\.create'
find_test_smells 'constants', 'Probably unecessary contants for creating objects', "create_user.*password"