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