Sha256: 1ef2b128b0d7d7ef5f6122bc312112e016b4a27924fa86dcdde9a6715c878196

Contents?: true

Size: 956 Bytes

Versions: 18

Compression:

Stored size: 956 Bytes

Contents

# -*- coding: utf-8 -*-
#
# @file 
# @brief
# @author ongaeshi
# @date   2012/04/15

require 'test_helper'
require 'file_assert'
require 'milkode/findgrep/findgrep'

module FindGrep
  class TestFindGrep < Test::Unit::TestCase
    def test_basic

      # 外部エンコーディング
      # p Encoding.default_external
      # p $stdout.external_encoding
      # 内部エンコーディング
      # p Encoding.default_internal
      # p $stdout.internal_encoding

      # Kconv::NOCONV
      # Kconv::SJIS
      # Kconv::UTF8

      Dir.chdir(File.join(File.dirname(__FILE__))) do
        File.open('data/.gitignore') do |f|
          assert_equal '#*.swp', FindGrep::file2lines(f, Kconv::UTF8)[-1]
        end

        File.open('data/a_project/cdstk.rb') do |f|
          # assert_equal 'end', FindGrep::file2lines(f, Kconv::UTF8)[-1]
          assert_equal 'end', FindGrep::file2lines(f, Kconv::SJIS)[-1]
        end
      end
    end
  end
end



Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
milkode-0.9.9 test/test_findgrep.rb
milkode-0.9.8 test/test_findgrep.rb
milkode-0.9.7 test/test_findgrep.rb
milkode-0.9.6 test/test_findgrep.rb
milkode-0.9.5 test/test_findgrep.rb
milkode-0.9.4 test/test_findgrep.rb
milkode-0.9.3.1 test/test_findgrep.rb
milkode-0.9.3 test/test_findgrep.rb
milkode-0.9.2 test/test_findgrep.rb
milkode-0.9.1.1 test/test_findgrep.rb
milkode-0.9.1 test/test_findgrep.rb
milkode-0.9.0 test/test_findgrep.rb
milkode-0.8.1 test/test_findgrep.rb
milkode-0.8.0 test/test_findgrep.rb
milkode-0.7.1 test/test_findgrep.rb
milkode-0.7.0 test/test_findgrep.rb
milkode-0.6.3 test/test_findgrep.rb
milkode-0.6.2 test/test_findgrep.rb