null+****@clear*****
null+****@clear*****
2012年 3月 6日 (火) 17:54:58 JST
Kouhei Sutou 2012-03-06 17:54:58 +0900 (Tue, 06 Mar 2012) New Revision: ef9bd9e681bc78b968eb29371ce86f5d91372572 Log: Ensure that groonga is ready before starting test Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+7 -0) =================================================================== --- lib/groonga/tester.rb 2012-03-06 17:52:26 +0900 (dc4b962) +++ lib/groonga/tester.rb 2012-03-06 17:54:58 +0900 (5203614) @@ -205,6 +205,7 @@ module Groonga def run_groonga(db_path) IO.popen([@tester.groonga, "-n", db_path], "r+") do |io| begin + ensure_groonga_ready(io) yield io ensure io.close unless io.closed? @@ -212,6 +213,12 @@ module Groonga end end + def ensure_groonga_ready(groonga) + groonga.print("status\n") + groonga.flush + groonga.gets + end + def normalize_result(result) normalized_result = "" result.each do |tag, content, options|