[Groonga-commit] groonga/groonga-command at a3f9963 [fix-travis-ci-error] column_list: add

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:28:43 JST 2016


Kouhei Sutou	2013-10-14 21:08:11 +0900 (Mon, 14 Oct 2013)

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

  Message:
    column_list: add

  Added files:
    test/command/test-column-list.rb
  Copied files:
    lib/groonga/command/column-list.rb
      (from lib/groonga/command.rb)
  Modified files:
    .yardopts
    lib/groonga/command.rb

  Modified: .yardopts (+1 -0)
===================================================================
--- .yardopts    2013-10-14 20:59:54 +0900 (a531f94)
+++ .yardopts    2013-10-14 21:08:11 +0900 (8bb9951)
@@ -2,5 +2,6 @@
 --no-private
 --output doc/reference/en
 --title "groonga-command API Reference"
+--markup markdown
 -
 doc/text/*

  Modified: lib/groonga/command.rb (+1 -0)
===================================================================
--- lib/groonga/command.rb    2013-10-14 20:59:54 +0900 (2d5d224)
+++ lib/groonga/command.rb    2013-10-14 21:08:11 +0900 (1cca53b)
@@ -21,6 +21,7 @@ require "groonga/command/version"
 require "groonga/command/error"
 
 require "groonga/command/column-create"
+require "groonga/command/column-list"
 require "groonga/command/column-remove"
 require "groonga/command/column-rename"
 require "groonga/command/delete"

  Copied: lib/groonga/command/column-list.rb (+25 -19) 52%
===================================================================
--- lib/groonga/command.rb    2013-10-14 20:59:54 +0900 (2d5d224)
+++ lib/groonga/command/column-list.rb    2013-10-14 21:08:11 +0900 (db7f01d)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2012-2013  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2013  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
@@ -16,23 +16,29 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-require "groonga/command/version"
+require "groonga/command/base"
 
-require "groonga/command/error"
+module Groonga
+  module Command
+    # A command class that represents `column_list` command.
+    #
+    # @since 1.0.6
+    class ColumnList < Base
+      Command.register("column_list", self)
 
-require "groonga/command/column-create"
-require "groonga/command/column-remove"
-require "groonga/command/column-rename"
-require "groonga/command/delete"
-require "groonga/command/dump"
-require "groonga/command/get"
-require "groonga/command/load"
-require "groonga/command/register"
-require "groonga/command/select"
-require "groonga/command/status"
-require "groonga/command/suggest"
-require "groonga/command/table-create"
-require "groonga/command/table-remove"
-require "groonga/command/table-rename"
-require "groonga/command/tokenize"
-require "groonga/command/truncate"
+      class << self
+        def parameter_names
+          [
+            :table,
+          ]
+        end
+      end
+
+      # @return [String] `table` parameter value.
+      # @since 1.0.6
+      def table
+        self[:table]
+      end
+    end
+  end
+end

  Added: test/command/test-column-list.rb (+48 -0) 100644
===================================================================
--- /dev/null
+++ test/command/test-column-list.rb    2013-10-14 21:08:11 +0900 (a47d595)
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+class ColumnListCommandTest < Test::Unit::TestCase
+  private
+  def column_list_command(pair_arguments={}, ordered_arguments=[])
+    Groonga::Command::ColumnList.new("column_list",
+                                     pair_arguments,
+                                     ordered_arguments)
+  end
+
+  class ConstructorTest < self
+    def test_ordered_arguments
+      table  = "Users"
+
+      ordered_arguments = [
+        table,
+      ]
+      command = column_list_command({}, ordered_arguments)
+      assert_equal({
+                     :table  => table,
+                   },
+                   command.arguments)
+    end
+  end
+
+  class TableTest < self
+    def test_reader
+      command = column_list_command(:table => "Users")
+      assert_equal("Users", command.table)
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



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