Moving to fixtures

This commit is contained in:
Arfon Smith
2014-09-17 08:37:00 -05:00
parent 302af86363
commit e70cd33323
3 changed files with 14 additions and 14 deletions

View File

@@ -447,22 +447,22 @@ class TestBlob < Test::Unit::TestCase
end
# Test language detection for files which shouldn't be used as samples
root = File.expand_path('../../test-files', __FILE__)
root = File.expand_path('../fixtures', __FILE__)
Dir.entries(root).each do |language|
next if language == '.' || language == '..'
next unless File.file?(language)
# Each directory contains test files of a language
dirname = File.join(root, language)
Dir.entries(dirname).each do |filename|
next if filename == '.' || filename == '..'
# By default blob search the file in the samples;
# thus, we need to give it the absolute path
filepath = File.join(dirname, filename)
blob = blob(filepath)
assert blob.language, "No language for #{filepath}"
assert_equal language, blob.language.name, blob.name
end
# Each directory contains test files of a language
dirname = File.join(root, language)
Dir.entries(dirname).each do |filename|
next unless File.file?(filename)
# By default blob search the file in the samples;
# thus, we need to give it the absolute path
filepath = File.join(dirname, filename)
blob = blob(filepath)
assert blob.language, "No language for #{filepath}"
assert_equal language, blob.language.name, blob.name
end
end
end