Allow tokens to be passed directly to classify

This commit is contained in:
Joshua Peek
2012-06-19 14:17:27 -05:00
parent d0691988a9
commit 8f85a447de
2 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
require 'linguist/classifier'
require 'linguist/language'
require 'linguist/sample'
require 'linguist/tokenizer'
require 'test/unit'
@@ -23,6 +24,10 @@ class TestClassifier < Test::Unit::TestCase
results = classifier.classify(fixture("objective-c/hello.m"))
assert_equal Language["Objective-C"], results.first[0]
tokens = Tokenizer.new(fixture("objective-c/hello.m")).tokens
results = classifier.classify(tokens)
assert_equal Language["Objective-C"], results.first[0]
end
def test_instance_classify_empty