Enable testing absence of heuristic result

This commit is contained in:
Paul Chaignon
2016-09-24 17:56:36 +02:00
parent e7e8a7d835
commit cd9401c424

View File

@@ -29,10 +29,14 @@ class TestHeuristcs < Minitest::Test
hash.each do |language, blobs|
Array(blobs).each do |blob|
result = Heuristics.call(file_blob(blob), candidates)
if language.nil?
assert_equal [], result, "Failed for #{blob}"
else
assert_equal [Language[language]], result, "Failed for #{blob}"
end
end
end
end
def test_detect_still_works_if_nothing_matches
blob = Linguist::FileBlob.new(File.join(samples_path, "Objective-C/hello.m"))