mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Use Rugged when computing Repository stats
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user