[Groonga-commit] droonga/fluent-plugin-droonga at ab27153 [master] GroongaCommandConverter: Add test for "load" command

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Sep 12 18:33:07 JST 2013


YUKI Hiroshi	2013-09-12 18:33:07 +0900 (Thu, 12 Sep 2013)

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

  Message:
    GroongaCommandConverter: Add test for "load" command

  Modified files:
    test/test_groonga_command_converter.rb

  Modified: test/test_groonga_command_converter.rb (+62 -0)
===================================================================
--- test/test_groonga_command_converter.rb    2013-09-12 15:32:27 +0900 (8d140be)
+++ test/test_groonga_command_converter.rb    2013-09-12 18:33:07 +0900 (aa2ca3e)
@@ -81,6 +81,68 @@ class GroongaCommandConverterTest < Test::Unit::TestCase
                  results)
   end
 
+  def test_load
+    results = []
+    command = "load --table Users\n" +
+                "[\n" +
+                "[\"_key\",\"name\"],\n" +
+                "[\"user0\",\"Abe Shinzo\"],\n" +
+                "[\"user1\",\"Noda Yoshihiko\"],\n",
+                "[\"user2\",\"Kan Naoto\"]\n" +
+                "]"
+    @converter.convert(command) do |droonga_command|
+      results << droonga_command
+    end
+    assert_equal([
+                   {
+                     :id => "test:0",
+                     :date => formatted_date,
+                     :replyTo => reply_to,
+                     :statusCode => status_code,
+                     :dataset => dataset,
+                     :type => "add",
+                     :body => {
+                       :table => "Users",
+                       :key => "user0",
+                       :values => {
+                         :name => "Abe Shinzo",
+                       },
+                     },
+                   },
+                   {
+                     :id => "test:1",
+                     :date => formatted_date,
+                     :replyTo => reply_to,
+                     :statusCode => status_code,
+                     :dataset => dataset,
+                     :type => "add",
+                     :body => {
+                       :table => "Users",
+                       :key => "user1",
+                       :values => {
+                         :name => "Noda Yoshihiko",
+                       },
+                     },
+                   },
+                   {
+                     :id => "test:2",
+                     :date => formatted_date,
+                     :replyTo => reply_to,
+                     :statusCode => status_code,
+                     :dataset => dataset,
+                     :type => "add",
+                     :body => {
+                       :table => "Users",
+                       :key => "user2",
+                       :values => {
+                         :name => "Kan Naoto",
+                       },
+                     },
+                   },
+                 ],
+                 results)
+  end
+
   private
   def date
     Time.new(2013, 11, 29, 0, 0, 0)
-------------- next part --------------
HTML����������������������������...
Download 



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