mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge branch 'master' into 1515-local
This commit is contained in:
@@ -262,6 +262,10 @@ class TestBlob < Test::Unit::TestCase
|
||||
|
||||
|
||||
assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil)
|
||||
|
||||
# Godep saved dependencies
|
||||
assert blob("Godeps/Godeps.json").generated?
|
||||
assert blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").generated?
|
||||
end
|
||||
|
||||
def test_vendored
|
||||
@@ -279,6 +283,10 @@ class TestBlob < Test::Unit::TestCase
|
||||
assert blob("app/bower_components/custom/custom.js").vendored?
|
||||
assert blob("vendor/assets/bower_components/custom/custom.js").vendored?
|
||||
|
||||
# Go dependencies
|
||||
assert !blob("Godeps/Godeps.json").vendored?
|
||||
assert blob("Godeps/_workspace/src/github.com/kr/s3/sign.go").vendored?
|
||||
|
||||
# Rails vendor/
|
||||
assert blob("vendor/plugins/will_paginate/lib/will_paginate.rb").vendored?
|
||||
|
||||
@@ -437,6 +445,12 @@ class TestBlob < Test::Unit::TestCase
|
||||
assert blob("octicons.css").vendored?
|
||||
assert blob("public/octicons.min.css").vendored?
|
||||
assert blob("public/octicons/sprockets-octicons.scss").vendored?
|
||||
|
||||
# Typesafe Activator
|
||||
assert blob("activator").vendored?
|
||||
assert blob("activator.bat").vendored?
|
||||
assert blob("subproject/activator").vendored?
|
||||
assert blob("subproject/activator.bat").vendored?
|
||||
end
|
||||
|
||||
def test_language
|
||||
|
||||
@@ -44,12 +44,12 @@ class TestClassifier < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_instance_classify_empty
|
||||
results = Classifier.classify(Samples::DATA, "")
|
||||
results = Classifier.classify(Samples.cache, "")
|
||||
assert results.first[1] < 0.5, results.first.inspect
|
||||
end
|
||||
|
||||
def test_instance_classify_nil
|
||||
assert_equal [], Classifier.classify(Samples::DATA, nil)
|
||||
assert_equal [], Classifier.classify(Samples.cache, nil)
|
||||
end
|
||||
|
||||
def test_classify_ambiguous_languages
|
||||
@@ -58,7 +58,7 @@ class TestClassifier < Test::Unit::TestCase
|
||||
languages = Language.find_by_filename(sample[:path]).map(&:name)
|
||||
next unless languages.length > 1
|
||||
|
||||
results = Classifier.classify(Samples::DATA, File.read(sample[:path]), languages)
|
||||
results = Classifier.classify(Samples.cache, File.read(sample[:path]), languages)
|
||||
assert_equal language.name, results.first[0], "#{sample[:path]}\n#{results.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,7 @@ class TestSamples < Test::Unit::TestCase
|
||||
include Linguist
|
||||
|
||||
def test_up_to_date
|
||||
assert serialized = Samples::DATA
|
||||
assert serialized = Samples.cache
|
||||
assert latest = Samples.data
|
||||
|
||||
# Just warn, it shouldn't scare people off by breaking the build.
|
||||
@@ -29,7 +29,7 @@ class TestSamples < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_verify
|
||||
assert data = Samples::DATA
|
||||
assert data = Samples.cache
|
||||
|
||||
assert_equal data['languages_total'], data['languages'].inject(0) { |n, (_, c)| n += c }
|
||||
assert_equal data['tokens_total'], data['language_tokens'].inject(0) { |n, (_, c)| n += c }
|
||||
@@ -38,7 +38,7 @@ class TestSamples < Test::Unit::TestCase
|
||||
|
||||
# Check that there aren't samples with extensions that aren't explicitly defined in languages.yml
|
||||
def test_parity
|
||||
extensions = Samples::DATA['extnames']
|
||||
extensions = Samples.cache['extnames']
|
||||
languages_yml = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
|
||||
languages = YAML.load_file(languages_yml)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user