[Groonga-commit] groonga/groonga-command at 4e40a94 [fix-travis-ci-error] Add column_rename

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:18:27 JST 2016


Kouhei Sutou	2012-11-25 19:36:39 +0900 (Sun, 25 Nov 2012)

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

  Message:
    Add column_rename

  Added files:
    lib/groonga/command/column-rename.rb
    test/command/test-column-rename.rb
  Modified files:
    lib/groonga/command/parser.rb

  Added: lib/groonga/command/column-rename.rb (+37 -0) 100644
===================================================================
--- /dev/null
+++ lib/groonga/command/column-rename.rb    2012-11-25 19:36:39 +0900 (5c033d0)
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012  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
+
+require "groonga/command/base"
+
+module Groonga
+  module Command
+    class ColumnRename < Base
+      Command.register("column_rename", self)
+
+      class << self
+        def parameter_names
+          [
+            :table,
+            :name,
+            :new_name,
+          ]
+        end
+      end
+    end
+  end
+end

  Modified: lib/groonga/command/parser.rb (+1 -0)
===================================================================
--- lib/groonga/command/parser.rb    2012-11-25 19:34:27 +0900 (424d489)
+++ lib/groonga/command/parser.rb    2012-11-25 19:36:39 +0900 (c0e8ba8)
@@ -26,6 +26,7 @@ require "groonga/command/table-remove"
 require "groonga/command/table-rename"
 require "groonga/command/column-create"
 require "groonga/command/column-remove"
+require "groonga/command/column-rename"
 
 module Groonga
   module Command

  Added: test/command/test-column-rename.rb (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/command/test-column-rename.rb    2012-11-25 19:36:39 +0900 (3ed8754)
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012  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 ColumnRenameCommandTest < Test::Unit::TestCase
+  class CommandLineTest < self
+    include GroongaCommandTestUtils::CommandLineCommandParser
+
+    def test_ordered_arguments
+      table    = "Users"
+      name     = "name"
+      new_name = "nick"
+
+      command = parse(table, name, new_name)
+      assert_instance_of(Groonga::Command::ColumnRename, command)
+      assert_equal({
+                     :table    => table,
+                     :name     => name,
+                     :new_name => new_name,
+                   },
+                   command.arguments)
+    end
+
+    private
+    def parse(*arguments)
+      super("column_rename", arguments, :output_type => false)
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



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