Use Rugged when computing Repository stats

This commit is contained in:
Vicent Marti
2014-06-16 15:19:56 +02:00
parent d40b4a33de
commit c4260ae681
7 changed files with 82 additions and 92 deletions

View File

@@ -34,11 +34,6 @@ class TestHeuristcs < Test::Unit::TestCase
assert_equal Language["C++"], results.first
end
def test_detect_still_works_if_nothing_matches
match = Language.detect("Hello.m", fixture("Objective-C/hello.m"))
assert_equal Language["Objective-C"], match
end
def test_pl_prolog_by_heuristics
languages = ["Perl", "Prolog"]
results = Heuristics.disambiguate_pl(fixture("Prolog/turing.pl"), languages)

View File

@@ -5,12 +5,9 @@ require 'test/unit'
class TestRepository < Test::Unit::TestCase
include Linguist
def repo(base_path)
Repository.from_directory(base_path)
end
def linguist_repo
repo(File.expand_path("../..", __FILE__))
r = Rugged::Repository.new(File.expand_path("../../.git", __FILE__))
Linguist::Repository.new(r, '31921838cdc252536ec07668f73d4b64d8022750')
end
def test_linguist_language
@@ -30,8 +27,4 @@ class TestRepository < Test::Unit::TestCase
assert linguist_repo.breakdown_by_file["Ruby"].include?("bin/linguist")
assert linguist_repo.breakdown_by_file["Ruby"].include?("lib/linguist/language.rb")
end
def test_binary_override
assert_equal repo(File.expand_path("../../samples/Nimrod", __FILE__)).language, Language["Nimrod"]
end
end