forked from github-linguist/linguist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_repository.rb
37 lines (28 loc) · 928 Bytes
/
test_repository.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'linguist/repository'
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__))
end
def test_linguist_language
# assert_equal Language['Ruby'], linguist_repo.language
end
def test_linguist_languages
# assert linguist_repo.languages[Language['Ruby']] > 10_000
end
def test_linguist_size
assert linguist_repo.size > 30_000
end
def test_linguist_breakdown
assert linguist_repo.breakdown_by_file.has_key?("Ruby")
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