Kouhei Sutou
null+****@clear*****
Wed Jul 17 15:14:09 JST 2013
Kouhei Sutou 2013-07-17 15:14:09 +0900 (Wed, 17 Jul 2013) New Revision: 38ce3c3b57e4c9232bc35160a57859f6cf433741 https://github.com/groonga/fluent-plugin-droonga/commit/38ce3c3b57e4c9232bc35160a57859f6cf433741 Message: test: extract stub worker into helper/ Copied files: test/helper/stub_worker.rb (from test/helper.rb) Modified files: test/helper.rb test/plugin/test_handler_add.rb test/plugin/test_handler_groonga.rb test/plugin/test_handler_search.rb Modified: test/helper.rb (+1 -0) =================================================================== --- test/helper.rb 2013-07-17 15:10:51 +0900 (d30cc8a) +++ test/helper.rb 2013-07-17 15:14:09 +0900 (23af164) @@ -15,6 +15,7 @@ require_relative "helper/sandbox" require_relative "helper/fixture" +require_relative "helper/stub_worker" class Test::Unit::TestCase include Sandbox Copied: test/helper/stub_worker.rb (+9 -5) 80% =================================================================== --- test/helper.rb 2013-07-17 15:10:51 +0900 (d30cc8a) +++ test/helper/stub_worker.rb 2013-07-17 15:14:09 +0900 (b7387c4) @@ -13,10 +13,14 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -require_relative "helper/sandbox" -require_relative "helper/fixture" +class StubWorker + attr_reader :context, :body -class Test::Unit::TestCase - include Sandbox - include Fixture + def initialize() + @context = Groonga::Context.default + end + + def post(body, destination=nil) + @body = body + end end Modified: test/plugin/test_handler_add.rb (+1 -13) =================================================================== --- test/plugin/test_handler_add.rb 2013-07-17 15:10:51 +0900 (4b02389) +++ test/plugin/test_handler_add.rb 2013-07-17 15:14:09 +0900 (cb73a32) @@ -15,18 +15,6 @@ require "droonga/plugin/handler_add" -class Worker - attr_reader :context, :body - - def initialize() - @context = Groonga::Context.default - end - - def post(body, destination=nil) - @body = body - end -end - class AddHandlerTest < Test::Unit::TestCase def setup setup_database @@ -62,7 +50,7 @@ class AddHandlerTest < Test::Unit::TestCase end def setup_handler - @worker = Worker.new + @worker = StubWorker.new @handler = Droonga::AddHandler.new(@worker) end Modified: test/plugin/test_handler_groonga.rb (+1 -13) =================================================================== --- test/plugin/test_handler_groonga.rb 2013-07-17 15:10:51 +0900 (6dc4f6c) +++ test/plugin/test_handler_groonga.rb 2013-07-17 15:14:09 +0900 (30636ed) @@ -15,18 +15,6 @@ require "droonga/plugin/handler_groonga" -class Worker - attr_reader :context, :body - - def initialize() - @context = Groonga::Context.default - end - - def post(body, destination=nil) - @body = body - end -end - class GroongaHandlerTest < Test::Unit::TestCase def setup setup_database @@ -52,7 +40,7 @@ class GroongaHandlerTest < Test::Unit::TestCase end def setup_handler - @worker = Worker.new + @worker = StubWorker.new @handler = Droonga::GroongaHandler.new(@worker) end Modified: test/plugin/test_handler_search.rb (+1 -13) =================================================================== --- test/plugin/test_handler_search.rb 2013-07-17 15:10:51 +0900 (d7139c3) +++ test/plugin/test_handler_search.rb 2013-07-17 15:14:09 +0900 (ce4fc59) @@ -15,18 +15,6 @@ require "droonga/plugin/handler_search" -class Worker - attr_reader :context, :body - - def initialize() - @context = Groonga::Context.default - end - - def post(body, destination=nil) - @body = body - end -end - class SearchHandlerTest < Test::Unit::TestCase def setup setup_database @@ -50,7 +38,7 @@ class SearchHandlerTest < Test::Unit::TestCase end def setup_handler - @worker = Worker.new + @worker = StubWorker.new @handler = Droonga::SearchHandler.new(@worker) end -------------- next part -------------- HTML����������������������������... 下载