Navigation Menu

Skip to content

Commit

Permalink
test: use subdirectory for temporary use to use tmpfs
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 6, 2012
1 parent a31f035 commit 257f2f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/lib/ruby/groonga-test-utils.rb
Expand Up @@ -26,16 +26,16 @@ module GroongaTestUtils
def setup_database_path
base_dir = ENV["BUILD_DIR"] || ENV["BASE_DIR"]
base_dir ||= File.join(File.dirname(__FILE__), "..", "..")
@tmp_base_dir = File.join(File.expand_path(base_dir), "tmp")
FileUtils.rm_rf(@tmp_base_dir)
@tmp_base_dir = File.join(File.expand_path(base_dir), "tmp", "ruby")
FileUtils.rm_rf(@tmp_base_dir, :secure => true)
FileUtils.mkdir_p(@tmp_base_dir)
@tmp_dir = Dir.mktmpdir("tmp", @tmp_base_dir)
@database_path = File.join(@tmp_dir, "database")
end

def teardown_database_path
@tmp_base_dir ||= nil
FileUtils.rm_rf(@tmp_base_dir) if @tmp_base_dir
FileUtils.rm_rf(@tmp_base_dir, :secure => true) if @tmp_base_dir
end

def setup_server(protocol=nil)
Expand Down

0 comments on commit 257f2f3

Please sign in to comment.