Move db verification into tests

This commit is contained in:
Joshua Peek
2012-07-23 12:21:26 -05:00
parent b7f58d96cb
commit 5b28336d56
2 changed files with 5 additions and 10 deletions

View File

@@ -64,7 +64,11 @@ class TestClassifier < Test::Unit::TestCase
end
def test_verify
assert Classifier.instance.verify
data = Classifier.instance.to_hash
assert_equal data['languages_total'], data['languages'].inject(0) { |n, (_, c)| n += c }
assert_equal data['tokens_total'], data['language_tokens'].inject(0) { |n, (_, c)| n += c }
assert_equal data['tokens_total'], data['tokens'].inject(0) { |n, (_, ts)| n += ts.inject(0) { |m, (_, c)| m += c } }
end
def test_gc