[Groonga-commit] droonga/fluent-plugin-droonga at 708cd33 [master] Delete needless helper

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Nov 20 12:50:40 JST 2013


YUKI Hiroshi	2013-11-20 12:50:40 +0900 (Wed, 20 Nov 2013)

  New Revision: 708cd33e6b87017f39eccff14f3df98b9654008a
  https://github.com/droonga/fluent-plugin-droonga/commit/708cd33e6b87017f39eccff14f3df98b9654008a

  Message:
    Delete needless helper

  Removed files:
    test/helper/database_helper.rb
  Modified files:
    test/helper.rb
    test/helper/sandbox.rb
    test/helper/watch_helper.rb
    test/plugin/handler/test_handler_add.rb
    test/plugin/handler/test_handler_search.rb

  Modified: test/helper.rb (+0 -1)
===================================================================
--- test/helper.rb    2013-11-20 12:38:11 +0900 (0feaea2)
+++ test/helper.rb    2013-11-20 12:50:40 +0900 (acb1c6e)
@@ -16,7 +16,6 @@
 require_relative "helper/sandbox"
 require_relative "helper/fixture"
 require_relative "helper/stub_worker"
-require_relative "helper/database_helper"
 require_relative "helper/watch_helper"
 
 class Test::Unit::TestCase

  Deleted: test/helper/database_helper.rb (+0 -28) 100644
===================================================================
--- test/helper/database_helper.rb    2013-11-20 12:38:11 +0900 (f1d1531)
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2013 Droonga Project
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-module DatabaseHelper
-  def setup_database
-    FileUtils.rm_rf(@database_path.dirname.to_s)
-    FileUtils.mkdir_p(@database_path.dirname.to_s)
-    @database = Groonga::Database.create(:path => @database_path.to_s)
-  end
-
-  def teardown_database
-    @database.close
-    @database = nil
-    FileUtils.rm_rf(@database_path.dirname.to_s)
-  end
-end

  Modified: test/helper/sandbox.rb (+9 -0)
===================================================================
--- test/helper/sandbox.rb    2013-11-20 12:38:11 +0900 (4808259)
+++ test/helper/sandbox.rb    2013-11-20 12:50:40 +0900 (151e722)
@@ -51,6 +51,15 @@ module Sandbox
     Groonga::Context.default_options = nil
   end
 
+  def setup_database
+    @database = Groonga::Database.create(:path => @database_path.to_s)
+  end
+
+  def teardown_database
+    @database.close
+    @database = nil
+  end
+
   def restore(dumped_command)
     context = Groonga::Context.new
     database = context.create_database(@database_path.to_s)

  Modified: test/helper/watch_helper.rb (+0 -2)
===================================================================
--- test/helper/watch_helper.rb    2013-11-20 12:38:11 +0900 (0259046)
+++ test/helper/watch_helper.rb    2013-11-20 12:50:40 +0900 (4f84886)
@@ -16,8 +16,6 @@
 require "droonga/watch_schema"
 
 module WatchHelper
-  include DatabaseHelper
-
   def setup_schema
     schema = Droonga::WatchSchema.new(Groonga::Context.default)
     schema.ensure_created

  Modified: test/plugin/handler/test_handler_add.rb (+0 -2)
===================================================================
--- test/plugin/handler/test_handler_add.rb    2013-11-20 12:38:11 +0900 (d048ec5)
+++ test/plugin/handler/test_handler_add.rb    2013-11-20 12:50:40 +0900 (782a153)
@@ -16,8 +16,6 @@
 require "droonga/plugin/handler_add"
 
 class AddHandlerTest < Test::Unit::TestCase
-  include DatabaseHelper
-
   def setup
     setup_database
     setup_schema

  Modified: test/plugin/handler/test_handler_search.rb (+1 -6)
===================================================================
--- test/plugin/handler/test_handler_search.rb    2013-11-20 12:38:11 +0900 (85e1f98)
+++ test/plugin/handler/test_handler_search.rb    2013-11-20 12:50:40 +0900 (bf00aba)
@@ -29,12 +29,7 @@ class SearchHandlerTest < Test::Unit::TestCase
   private
   def setup_database
     restore(fixture_data("document.grn"))
-    @database = Groonga::Database.open(@database_path.to_s)
-  end
-
-  def teardown_database
-    @database.close
-    @database = nil
+    super
   end
 
   def setup_handler
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index