[Groonga-commit] ranguba/groonga-client at cafa443 [master] test: use more meaningful assertion

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Oct 25 15:13:41 JST 2017


Kouhei Sutou	2017-10-25 15:13:41 +0900 (Wed, 25 Oct 2017)

  New Revision: cafa4434f4852da287a223d9f46a8d0f42c1986c
  https://github.com/ranguba/groonga-client/commit/cafa4434f4852da287a223d9f46a8d0f42c1986c

  Message:
    test: use more meaningful assertion

  Modified files:
    test/response/test-column-list.rb

  Modified: test/response/test-column-list.rb (+20 -2)
===================================================================
--- test/response/test-column-list.rb    2017-10-25 15:05:38 +0900 (d1a9d07)
+++ test/response/test-column-list.rb    2017-10-25 15:13:41 +0900 (e4c588f)
@@ -20,7 +20,15 @@ require "response/helper"
 class TestResponseColumnList < Test::Unit::TestCase
   include TestResponseHelper
 
-  def test_column_list
+  def column(attributes)
+    c = Groonga::Client::Response::ColumnList::Column.new
+    attributes.each do |name, value|
+      c[name] = value
+    end
+    c
+  end
+
+  def test_parse
     header = [0, 1372430096.70991, 0.000522851943969727]
     body = [
       [
@@ -47,7 +55,17 @@ class TestResponseColumnList < Test::Unit::TestCase
     raw_response = [header, body].to_json
 
     response = parse_raw_response("column_list", raw_response)
-    assert_equal(Groonga::Client::Response::ColumnList, response.class)
+    assert_equal([
+                   column(:id => 256,
+                          :name => "Text",
+                          :path => "/tmp/test.db.0000100",
+                          :type => "var",
+                          :flags => "COLUMN_SCALAR|PERSISTENT",
+                          :domain => "TestTable",
+                          :range => "ShortText",
+                          :source => []),
+                 ],
+                 response.to_a)
   end
 end
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171025/8bafc21c/attachment.htm 



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