Sha256: 4ad52a2bce74506591451ead7ea326ddc4ce7d5400c2a958dc93ce55e349ce27

Contents?: true

Size: 1.07 KB

Versions: 30

Compression:

Stored size: 1.07 KB

Contents

# -*- coding: utf-8 -*-
#
# @file 
# @brief
# @author ongaeshi
# @date   2012/09/29

require 'milkode/common/plang_detector'
require 'test_helper'

module Milkode
  class TestPlangDetector < Test::Unit::TestCase
    def test_name
      assert_equal 'ActionScript', PlangDetector.new('Dummy.as').name
      assert_equal 'C'           , PlangDetector.new('a.c').name
      assert_equal 'C'           , PlangDetector.new('a.h').name
      assert_equal 'C#'          , PlangDetector.new('AssemblyInfo.cs').name
      assert_equal 'C++'         , PlangDetector.new('path/to/file.hpp').name
      assert_equal 'Ruby'        , PlangDetector.new('template.rb').name
      assert_equal 'README'      , PlangDetector.new('readme.txt').name
      assert_equal 'JavaScript'  , PlangDetector.new('main.js').name
      assert_equal 'Visual Studio', PlangDetector.new('hoge.sln').name
    end

    def test_unknown
      assert_equal 'unknown', PlangDetector.new('').name
      assert_equal 'unknown', PlangDetector.new('.').name
      assert_equal 'unknown', PlangDetector.new('abcdefg').name
    end
  end
end


Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
milkode-1.8.9.2 test/test_plang_detector.rb
milkode-1.8.9.1 test/test_plang_detector.rb
milkode-1.8.9 test/test_plang_detector.rb
milkode-1.8.8 test/test_plang_detector.rb
milkode-1.8.7 test/test_plang_detector.rb
milkode-1.8.6 test/test_plang_detector.rb
milkode-1.8.5 test/test_plang_detector.rb
milkode-1.8.4 test/test_plang_detector.rb
milkode-1.8.3 test/test_plang_detector.rb
milkode-1.8.2 test/test_plang_detector.rb
milkode-1.8.1 test/test_plang_detector.rb
milkode-1.8.0 test/test_plang_detector.rb
milkode-1.7.1 test/test_plang_detector.rb
milkode-1.7.0 test/test_plang_detector.rb
milkode-1.6.1 test/test_plang_detector.rb
milkode-1.6.0 test/test_plang_detector.rb
milkode-1.5.0 test/test_plang_detector.rb
milkode-1.4.0 test/test_plang_detector.rb
milkode-1.3.0 test/test_plang_detector.rb
milkode-1.2.0 test/test_plang_detector.rb