diff --git a/test-files/Python/run_tests.module b/test/fixtures/Python/run_tests.module similarity index 100% rename from test-files/Python/run_tests.module rename to test/fixtures/Python/run_tests.module diff --git a/test-files/Shell/mintleaf.module b/test/fixtures/Shell/mintleaf.module similarity index 100% rename from test-files/Shell/mintleaf.module rename to test/fixtures/Shell/mintleaf.module diff --git a/test/test_blob.rb b/test/test_blob.rb index 764b6a3e..ecd89dd3 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -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