Merge branch 'master' into cpp_heuristic

Conflicts:
	lib/linguist/samples.json
This commit is contained in:
Arfon Smith
2013-12-22 19:25:01 -06:00
9 changed files with 1217 additions and 492 deletions

View File

@@ -14,7 +14,7 @@ class TestHeuristcs < Test::Unit::TestCase
def fixture(name)
File.read(File.join(samples_path, name))
end
# Only calling out '.h' filenames as these are the ones causing issues
def all_h_fixtures(language_name)
Dir.glob("#{samples_path}/#{language_name}/*.h")
@@ -23,7 +23,7 @@ class TestHeuristcs < Test::Unit::TestCase
def test_obj_c_by_heuristics
languages = ["C++", "Objective-C"]
all_h_fixtures("Objective-C").each do |fixture|
results = Heuristics.find_by_heuristics(fixture("Objective-C/#{File.basename(fixture)}"), languages)
results = Heuristics.disambiguate_h(fixture("Objective-C/#{File.basename(fixture)}"), languages)
assert_equal Language["Objective-C"], results.first
end
end