Sha256: e89a978a7c4fefe70b6391a202b8af7ec8d5c2d37e80373176fde74366135bfe

Contents?: true

Size: 951 Bytes

Versions: 24

Compression:

Stored size: 951 Bytes

Contents

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

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

module Milkode
  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

24 entries across 24 versions & 1 rubygems

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