diff options
| author | Joshua Peek <josh@joshpeek.com> | 2012-06-19 14:17:27 -0500 |
|---|---|---|
| committer | Joshua Peek <josh@joshpeek.com> | 2012-06-19 14:17:27 -0500 |
| commit | 8f85a447de51f9e5c0201b61f124695d6578d804 (patch) | |
| tree | e60627d5228ae464614c6fb67c9745a7ae2b975d /test/test_classifier.rb | |
| parent | d0691988a9409bb2c7a8a3c5add50e9d33354859 (diff) | |
Allow tokens to be passed directly to classify
Diffstat (limited to 'test/test_classifier.rb')
| -rw-r--r-- | test/test_classifier.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_classifier.rb b/test/test_classifier.rb index 38c4df5..9280d15 100644 --- a/test/test_classifier.rb +++ b/test/test_classifier.rb @@ -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 |
