[Groonga-commit] droonga/drntest at ca5ab10 [master] Extract post process for response

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 14 22:52:40 JST 2014


Kouhei Sutou	2014-07-14 22:52:40 +0900 (Mon, 14 Jul 2014)

  New Revision: ca5ab1068c0047e54155863bdb1113f550701c88
  https://github.com/droonga/drntest/commit/ca5ab1068c0047e54155863bdb1113f550701c88

  Message:
    Extract post process for response

  Modified files:
    lib/drntest/test-executor.rb

  Modified: lib/drntest/test-executor.rb (+17 -13)
===================================================================
--- lib/drntest/test-executor.rb    2014-05-29 22:37:52 +0900 (eda6159)
+++ lib/drntest/test-executor.rb    2014-07-14 22:52:40 +0900 (0b8bb13)
@@ -102,19 +102,8 @@ module Drntest
 
       def execute_request(request)
         if @logging
-          request_process =****@clien*****(request) do |response|
-            begin
-              @responses << normalize_response(request, response)
-            rescue
-              @responses << {
-                "error" => {
-                  "message" => "failed to normalize response",
-                  "detail" => "#{$!.message} (#{$!.class})",
-                  "backtrace" => $!.backtrace,
-                  "response" => response,
-                },
-              }
-            end
+          request_process =****@clien*****(request) do |raw_response|
+            @responses << clean_response(request, raw_response)
           end
           request_process.wait
         else
@@ -123,6 +112,21 @@ module Drntest
         end
       end
 
+      def clean_response(request, raw_response)
+        begin
+          normalize_response(request, raw_response)
+        rescue
+          {
+            "error" => {
+              "message" => "failed to normalize response",
+              "detail" => "#{$!.message} (#{$!.class})",
+              "backtrace" => $!.backtrace,
+                  "response" => raw_response,
+            },
+          }
+        end
+      end
+
       def consume_requests
         @requests.each do |request|
           request.wait
-------------- next part --------------
HTML����������������������������...
Download 



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