[Groonga-commit] groonga/groonga-command at e83c167 [master] dump: add ordered arguments

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jan 14 19:42:31 JST 2016


Kouhei Sutou	2016-01-14 19:42:31 +0900 (Thu, 14 Jan 2016)

  New Revision: e83c167dba7a34e794ad1c996b76d0f49f69ad69
  https://github.com/groonga/groonga-command/commit/e83c167dba7a34e794ad1c996b76d0f49f69ad69

  Message:
    dump: add ordered arguments

  Modified files:
    lib/groonga/command/dump.rb
    test/command/test-dump.rb

  Modified: lib/groonga/command/dump.rb (+14 -1)
===================================================================
--- lib/groonga/command/dump.rb    2016-01-13 18:02:53 +0900 (8ba57a6)
+++ lib/groonga/command/dump.rb    2016-01-14 19:42:31 +0900 (913d2d3)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2013-2016  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,19 @@ module Groonga
     class Dump < Base
       Command.register("dump", self)
 
+      class << self
+        def parameter_names
+          [
+            :tables,
+            :dump_plugins,
+            :dump_schema,
+            :dump_records,
+            :dump_indexes,
+            :dump_confs,
+          ]
+        end
+      end
+
       def output_type
         :none
       end

  Modified: test/command/test-dump.rb (+31 -1)
===================================================================
--- test/command/test-dump.rb    2016-01-13 18:02:53 +0900 (2b01118)
+++ test/command/test-dump.rb    2016-01-14 19:42:31 +0900 (36e0e6f)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2013-2016  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,36 @@ class DumpCommandTest < Test::Unit::TestCase
     Groonga::Command::Dump.new("dump", pair_arguments, ordered_arguments)
   end
 
+  class ConstructorTest < self
+    def test_ordered_arguments
+      tables       = "Users, Logs"
+      dump_plugins = "no"
+      dump_schema  = "yes"
+      dump_records = "no"
+      dump_indexes = "yes"
+      dump_confs   = "no"
+
+      command = dump_command({},
+                             [
+                               tables,
+                               dump_plugins,
+                               dump_schema,
+                               dump_records,
+                               dump_indexes,
+                               dump_confs,
+                             ])
+      assert_equal({
+                     :tables       => tables,
+                     :dump_plugins => dump_plugins,
+                     :dump_schema  => dump_schema,
+                     :dump_records => dump_records,
+                     :dump_indexes => dump_indexes,
+                     :dump_confs   => dump_confs,
+                   },
+                   command.arguments)
+    end
+  end
+
   class OutputTypeTest < self
     def test_none
       assert_equal(:none, dump_command.output_type)
-------------- next part --------------
HTML����������������������������...
Download 



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