[Groonga-commit] droonga/fluent-plugin-droonga at 0217097 [master] Follow to the new response format of the Groonga commands

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 24 13:26:54 JST 2014


YUKI Hiroshi	2014-01-24 13:26:54 +0900 (Fri, 24 Jan 2014)

  New Revision: 0217097df9d3594e53fdc001ae683dd220b152c7
  https://github.com/droonga/fluent-plugin-droonga/commit/0217097df9d3594e53fdc001ae683dd220b152c7

  Message:
    Follow to the new response format of the Groonga commands

  Modified files:
    test/unit/plugin/handler/groonga/test_column_create.rb
    test/unit/plugin/handler/groonga/test_table_create.rb
    test/unit/plugin/handler/groonga/test_table_remove.rb
    test/unit/plugin/handler/test_groonga.rb

  Modified: test/unit/plugin/handler/groonga/test_column_create.rb (+2 -2)
===================================================================
--- test/unit/plugin/handler/groonga/test_column_create.rb    2014-01-24 13:22:02 +0900 (63418e8)
+++ test/unit/plugin/handler/groonga/test_column_create.rb    2014-01-24 13:26:54 +0900 (e64f33a)
@@ -19,7 +19,7 @@ class ColumnCreateTest < GroongaHandlerTest
     process(:column_create,
             {"table" => "Books", "name" => "title", "type" => "ShortText"})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
@@ -29,7 +29,7 @@ class ColumnCreateTest < GroongaHandlerTest
     process(:column_create,
             {"table" => "Unknown", "name" => "title", "type" => "ShortText"})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )

  Modified: test/unit/plugin/handler/groonga/test_table_create.rb (+2 -2)
===================================================================
--- test/unit/plugin/handler/groonga/test_table_create.rb    2014-01-24 13:22:02 +0900 (0992e17)
+++ test/unit/plugin/handler/groonga/test_table_create.rb    2014-01-24 13:26:54 +0900 (d32b1e8)
@@ -17,7 +17,7 @@ class TableCreateTest < GroongaHandlerTest
   def test_success
     process(:table_create, {"name" => "Books"})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
@@ -26,7 +26,7 @@ class TableCreateTest < GroongaHandlerTest
   def test_failure
     process(:table_create, {})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )

  Modified: test/unit/plugin/handler/groonga/test_table_remove.rb (+2 -2)
===================================================================
--- test/unit/plugin/handler/groonga/test_table_remove.rb    2014-01-24 13:22:02 +0900 (30aeb75)
+++ test/unit/plugin/handler/groonga/test_table_remove.rb    2014-01-24 13:26:54 +0900 (9c2659d)
@@ -22,7 +22,7 @@ class TableRemoveTest < GroongaHandlerTest
   def test_success
     process(:table_remove, {"name" => "Books"})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
@@ -33,7 +33,7 @@ class TableRemoveTest < GroongaHandlerTest
   def test_failure
     process(:table_remove, {})
     response =****@messe*****
-    assert_equal(
+    assert_result_equal(
       [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )

  Modified: test/unit/plugin/handler/test_groonga.rb (+10 -1)
===================================================================
--- test/unit/plugin/handler/test_groonga.rb    2014-01-24 13:22:02 +0900 (3252470)
+++ test/unit/plugin/handler/test_groonga.rb    2014-01-24 13:26:54 +0900 (f330dc9)
@@ -56,7 +56,6 @@ class GroongaHandlerTest < Test::Unit::TestCase
     [header[0], start_time, elapsed_time]
   end
 
-
   NORMALIZED_HEADER_SUCCESS = [
     Droonga::GroongaHandler::Status::SUCCESS,
     NORMALIZED_START_TIME,
@@ -67,4 +66,14 @@ class GroongaHandlerTest < Test::Unit::TestCase
     NORMALIZED_START_TIME,
     NORMALIZED_ELAPSED_TIME,
   ]
+
+  def format_outputs(result)
+    {
+      "result" => result,
+    }
+  end
+
+  def assert_result_equal(expected, actual)
+    assert_equal(format_outputs(expected), format_outputs(actual))
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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