Sha256: f9007e14caa7e2c8b998fca6a2108ed8a3a21cac52ac5762e2fdfb7b34fc98ab

Contents?: true

Size: 1.23 KB

Versions: 36

Compression:

Stored size: 1.23 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

36 entries across 36 versions & 1 rubygems

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