Move Linguist::Language.detect to Linguist.detect

This commit is contained in:
Brandon Keepers
2015-04-17 14:56:08 +12:00
parent 745ce14d47
commit 924fddf698
5 changed files with 85 additions and 41 deletions

View File

@@ -40,7 +40,7 @@ class TestHeuristcs < Minitest::Test
def test_detect_still_works_if_nothing_matches
blob = Linguist::FileBlob.new(File.join(samples_path, "Objective-C/hello.m"))
match = Language.detect(blob)
match = Linguist.detect(blob)
assert_equal Language["Objective-C"], match
end

View File

@@ -28,7 +28,7 @@ class TestInstrumentation < Minitest::Test
def test_detection_instrumentation_with_binary_blob
binary_blob = fixture_blob("Binary/octocat.ai")
Language.detect(binary_blob)
Linguist.detect(binary_blob)
# Shouldn't instrument this (as it's binary)
assert_equal 0, Linguist.instrumenter.events.size
@@ -36,7 +36,7 @@ class TestInstrumentation < Minitest::Test
def test_modeline_instrumentation
blob = fixture_blob("Data/Modelines/ruby")
Language.detect(blob)
Linguist.detect(blob)
detect_event = Linguist.instrumenter.events.last
detect_event_payload = detect_event[:args].first