Sha256: 5d83bb46a87afcd97ea3d8aa992f27270f6284048e2e91495507eaad6ca3b55f

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

# -*- coding: utf-8 -*-
#
# @file 
# @brief
# @author ongaeshi
# @date   2010/xx/xxxx

require 'test_helper'
require 'milkode/database/groonga_database'

module Milkode
  class TestGroongaDatabase < Test::Unit::TestCase
    def test_database
      begin
        t_setup
        t_open
      ensure
        t_cleanup
      end
    end

    def t_setup
      @obj = GroongaDatabase.new
      @tmp_dir = File.join(File.dirname(__FILE__), "groonga_database_work")
    end
    
    def t_cleanup
      # 本当は明示的にcloseした方が行儀が良いのだけれど、
      # 単体テストの時にSementationFaultが出るのでコメントアウト
      # @obj.close

      # データベース削除
      @obj = nil
      FileUtils.rm_rf(@tmp_dir)
    end

    def t_open
      @obj.open(@tmp_dir)
      # @obj.close
    end

    # def test_compatible?
    #   begin
    #     t_setup

    #     # 互換性の無いGroongaデータベースを作る
    #     filename = Dbdir.groonga_path(@tmp_dir)
    #     FileUtils.mkdir_p(File.dirname filename) 
    #     Groonga::Database.create(:path => filename)
    #     # DocumentTable.define_schema

    #     assert_equal nil, @obj.compatible?(filename, true)
    #   ensure
    #     t_cleanup
    #   end
    # end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
milkode-1.8.9.2 test/test_groonga_database.rb
milkode-1.8.9.1 test/test_groonga_database.rb