Revision dd6dc93f
Added by Justin Sherrill almost 10 years ago
Rakefile | ||
---|---|---|
60 | 60 |
end |
61 | 61 |
end |
62 | 62 |
|
63 |
desc "Finds functions without dedicated tests" |
|
64 |
task :untested do |
|
65 |
test_functions = `grep -r 'def test_' test/ --exclude-dir=test/fixtures --include=*.rb --no-filename` |
|
66 |
lib_functions = `grep -r 'def self' lib/ --exclude=base.rb --include=*.rb --no-filename` |
|
67 |
|
|
68 |
test_functions = test_functions.split("\n").map{ |str| str.strip.split("def test_")[1] }.to_set |
|
69 |
lib_functions = lib_functions.split("\n").map{ |str| str.strip.split("def self.")[1].split("(").first }.to_set |
|
70 |
|
|
71 |
difference = (lib_functions - test_functions).to_a |
|
72 |
|
|
73 |
if !difference.empty? |
|
74 |
puts difference |
|
75 |
exit 1 |
|
76 |
end |
|
77 |
end |
|
78 |
|
|
79 | 63 |
desc "Clears out all cassette files" |
80 | 64 |
task :clear_cassettes do |
81 | 65 |
clear_cassettes |
Also available in: Unified diff
removing untested rake task as its no longer reliable