YUKI Hiroshi
null+****@clear*****
Wed Nov 20 14:54:07 JST 2013
YUKI Hiroshi 2013-11-20 14:54:07 +0900 (Wed, 20 Nov 2013) New Revision: 64378042410326260d6e1104f0d9773527458ab0 https://github.com/droonga/fluent-plugin-droonga/commit/64378042410326260d6e1104f0d9773527458ab0 Message: Test: use local variable Modified files: test/helper/handler_helper.rb test/plugin/handler/groonga/test_column_create.rb test/plugin/handler/groonga/test_table_create.rb test/plugin/handler/test_handler_groonga.rb test/plugin/handler/test_handler_search.rb Modified: test/helper/handler_helper.rb (+2 -4) =================================================================== --- test/helper/handler_helper.rb 2013-11-20 14:45:26 +0900 (f948f1b) +++ test/helper/handler_helper.rb 2013-11-20 14:54:07 +0900 (dc63895) @@ -14,11 +14,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module HandlerHelper - attr_reader :messages - - def setup_stub_emit(handler) + def setup_stub_emit @messages = [] - stub(handler).emit do |message| + stub(@handler).emit do |message| @messages << message end end Modified: test/plugin/handler/groonga/test_column_create.rb (+1 -1) =================================================================== --- test/plugin/handler/groonga/test_column_create.rb 2013-11-20 14:45:26 +0900 (b12140d) +++ test/plugin/handler/groonga/test_column_create.rb 2013-11-20 14:54:07 +0900 (49f0477) @@ -17,7 +17,7 @@ class ColumnCreateTest < GroongaHandlerTest def test_success @handler.table_create({"name" => "Books"}) @handler.column_create({"table" => "Books", "name" => "title", "type" => "ShortText"}) - assert_equal([true], messages.last) + assert_equal([true], @messages.last) end def test_name Modified: test/plugin/handler/groonga/test_table_create.rb (+2 -2) =================================================================== --- test/plugin/handler/groonga/test_table_create.rb 2013-11-20 14:45:26 +0900 (f94be8e) +++ test/plugin/handler/groonga/test_table_create.rb 2013-11-20 14:54:07 +0900 (fe820f4) @@ -16,7 +16,7 @@ class TableCreateTest < GroongaHandlerTest def test_success @handler.table_create({"name" => "Books"}) - response = messages.last + response =****@messa***** assert_equal( [[Droonga::GroongaHandler::Status::SUCCESS, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], true], [normalize_header(response.first), response.last] @@ -25,7 +25,7 @@ class TableCreateTest < GroongaHandlerTest def test_failure @handler.table_create({}) - response = messages.last + response =****@messa***** assert_equal( [[Droonga::GroongaHandler::Status::INVALID_ARGUMENT, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], false], [normalize_header(response.first), response.last] Modified: test/plugin/handler/test_handler_groonga.rb (+1 -1) =================================================================== --- test/plugin/handler/test_handler_groonga.rb 2013-11-20 14:45:26 +0900 (ba92a19) +++ test/plugin/handler/test_handler_groonga.rb 2013-11-20 14:54:07 +0900 (1c65913) @@ -32,7 +32,7 @@ class GroongaHandlerTest < Test::Unit::TestCase def setup_handler @worker = StubWorker.new @handler = Droonga::GroongaHandler.new(@worker) - setup_stub_emit(@handler) + setup_stub_emit end def teardown_handler Modified: test/plugin/handler/test_handler_search.rb (+2 -2) =================================================================== --- test/plugin/handler/test_handler_search.rb 2013-11-20 14:45:26 +0900 (7db02e6) +++ test/plugin/handler/test_handler_search.rb 2013-11-20 14:54:07 +0900 (8020850) @@ -35,7 +35,7 @@ class SearchHandlerTest < Test::Unit::TestCase def setup_handler @worker = StubWorker.new @handler = Droonga::SearchHandler.new(@worker) - setup_stub_emit(@handler) + setup_stub_emit end def teardown_handler @@ -44,7 +44,7 @@ class SearchHandlerTest < Test::Unit::TestCase def search(request) @handler.search(request) - normalize_result_set(messages.last) + normalize_result_set(@messages.last) end def normalize_result_set(result_set) -------------- next part -------------- HTML����������������������������... 다운로드