YUKI Hiroshi
null+****@clear*****
Wed Nov 20 14:25:18 JST 2013
YUKI Hiroshi 2013-11-20 14:25:18 +0900 (Wed, 20 Nov 2013) New Revision: a8d333dd22c2f32144eaad6eb3d412dd82e91b6a https://github.com/droonga/fluent-plugin-droonga/commit/a8d333dd22c2f32144eaad6eb3d412dd82e91b6a Message: Test: store multiple emitted messages Modified files: test/helper/handler_helper.rb test/plugin/handler/groonga/test_table_create.rb Modified: test/helper/handler_helper.rb (+6 -2) =================================================================== --- test/helper/handler_helper.rb 2013-11-20 14:22:43 +0900 (5d2ed2d) +++ test/helper/handler_helper.rb 2013-11-20 14:25:18 +0900 (2651c95) @@ -17,9 +17,13 @@ module HandlerHelper attr_reader :emitted def setup_stub_emit(handler) - @emitted = nil + @emitted = [] stub(handler).emit do |response| - @emitted = response + @emitted << response end end + + def last_emitted + @emitted.last + end end Modified: test/plugin/handler/groonga/test_table_create.rb (+2 -2) =================================================================== --- test/plugin/handler/groonga/test_table_create.rb 2013-11-20 14:22:43 +0900 (c8aa7f8) +++ test/plugin/handler/groonga/test_table_create.rb 2013-11-20 14:25:18 +0900 (12f1473) @@ -19,7 +19,7 @@ class TableCreateTest < GroongaHandlerTest @handler.table_create({"name" => "Books"}) assert_equal( [[Droonga::GroongaHandler::Status::SUCCESS, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], true], - [normalize_header(emitted.first), emitted.last] + [normalize_header(last_emitted.first), last_emitted.last] ) end @@ -28,7 +28,7 @@ class TableCreateTest < GroongaHandlerTest @handler.table_create({}) assert_equal( [[Droonga::GroongaHandler::Status::INVALID_ARGUMENT, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], false], - [normalize_header(emitted.first), emitted.last] + [normalize_header(last_emitted.first), last_emitted.last] ) end -------------- next part -------------- HTML����������������������������...Download