[Groonga-commit] droonga/fluent-plugin-droonga at bfd0363 [master] Define expected normalize headers as constants

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jan 23 10:50:35 JST 2014


YUKI Hiroshi	2014-01-23 10:50:35 +0900 (Thu, 23 Jan 2014)

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

  Message:
    Define expected normalize headers as constants

  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-23 10:47:05 +0900 (b9fe374)
+++ test/unit/plugin/handler/groonga/test_column_create.rb    2014-01-23 10:50:35 +0900 (63418e8)
@@ -20,7 +20,7 @@ class ColumnCreateTest < GroongaHandlerTest
             {"table" => "Books", "name" => "title", "type" => "ShortText"})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::SUCCESS, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], true],
+      [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
   end
@@ -30,7 +30,7 @@ class ColumnCreateTest < GroongaHandlerTest
             {"table" => "Unknown", "name" => "title", "type" => "ShortText"})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::INVALID_ARGUMENT, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], false],
+      [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )
   end

  Modified: test/unit/plugin/handler/groonga/test_table_create.rb (+2 -2)
===================================================================
--- test/unit/plugin/handler/groonga/test_table_create.rb    2014-01-23 10:47:05 +0900 (744486c)
+++ test/unit/plugin/handler/groonga/test_table_create.rb    2014-01-23 10:50:35 +0900 (0992e17)
@@ -18,7 +18,7 @@ class TableCreateTest < GroongaHandlerTest
     process(:table_create, {"name" => "Books"})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::SUCCESS, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], true],
+      [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
   end
@@ -27,7 +27,7 @@ class TableCreateTest < GroongaHandlerTest
     process(:table_create, {})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::INVALID_ARGUMENT, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], false],
+      [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )
   end

  Modified: test/unit/plugin/handler/groonga/test_table_remove.rb (+2 -2)
===================================================================
--- test/unit/plugin/handler/groonga/test_table_remove.rb    2014-01-23 10:47:05 +0900 (92811ce)
+++ test/unit/plugin/handler/groonga/test_table_remove.rb    2014-01-23 10:50:35 +0900 (30aeb75)
@@ -23,7 +23,7 @@ class TableRemoveTest < GroongaHandlerTest
     process(:table_remove, {"name" => "Books"})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::SUCCESS, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], true],
+      [NORMALIZED_HEADER_SUCCESS, true],
       [normalize_header(response.first), response.last]
     )
     assert_equal(<<-SCHEMA, dump)
@@ -34,7 +34,7 @@ class TableRemoveTest < GroongaHandlerTest
     process(:table_remove, {})
     response =****@messe*****
     assert_equal(
-      [[Droonga::GroongaHandler::Status::INVALID_ARGUMENT, NORMALIZED_START_TIME, NORMALIZED_ELAPSED_TIME], false],
+      [NORMALIZED_HEADER_INVALID_ARGUMENT, false],
       [normalize_header(response.first), response.last]
     )
   end

  Modified: test/unit/plugin/handler/test_groonga.rb (+12 -0)
===================================================================
--- test/unit/plugin/handler/test_groonga.rb    2014-01-23 10:47:05 +0900 (5a0b8be)
+++ test/unit/plugin/handler/test_groonga.rb    2014-01-23 10:50:35 +0900 (3252470)
@@ -55,4 +55,16 @@ class GroongaHandlerTest < Test::Unit::TestCase
     elapsed_time = NORMALIZED_ELAPSED_TIME
     [header[0], start_time, elapsed_time]
   end
+
+
+  NORMALIZED_HEADER_SUCCESS = [
+    Droonga::GroongaHandler::Status::SUCCESS,
+    NORMALIZED_START_TIME,
+    NORMALIZED_ELAPSED_TIME,
+  ]
+  NORMALIZED_HEADER_INVALID_ARGUMENT = [
+    Droonga::GroongaHandler::Status::INVALID_ARGUMENT,
+    NORMALIZED_START_TIME,
+    NORMALIZED_ELAPSED_TIME,
+  ]
 end
-------------- next part --------------
HTML����������������������������...
Download 



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