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.1.0 test/test_findgrep.rb
milkode-1.0.2 test/test_findgrep.rb
milkode-1.0.0 test/test_findgrep.rb
milkode-0.9.9.9 test/test_findgrep.rb