[Groonga-commit] groonga/groonga-command [master] Add table_remove

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Nov 25 19:08:00 JST 2012


Kouhei Sutou	2012-11-25 19:08:00 +0900 (Sun, 25 Nov 2012)

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

  Log:
    Add table_remove

  Added files:
    lib/groonga/command/table-remove.rb
    test/command/test-table-remove.rb
  Modified files:
    lib/groonga/command/parser.rb

  Modified: lib/groonga/command/parser.rb (+1 -0)
===================================================================
--- lib/groonga/command/parser.rb    2012-11-25 18:14:08 +0900 (b47ffff)
+++ lib/groonga/command/parser.rb    2012-11-25 19:08:00 +0900 (9567339)
@@ -22,6 +22,7 @@ require "cgi"
 require "groonga/command/base"
 require "groonga/command/select"
 require "groonga/command/table-create"
+require "groonga/command/table-remove"
 
 module Groonga
   module Command

  Added: lib/groonga/command/table-remove.rb (+35 -0) 100644
===================================================================
--- /dev/null
+++ lib/groonga/command/table-remove.rb    2012-11-25 19:08:00 +0900 (5f6d82b)
@@ -0,0 +1,35 @@
+# -*- 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 TableRemove < Base
+      Command.register("table_remove", self)
+
+      class << self
+        def parameter_names
+          [
+            :name,
+          ]
+        end
+      end
+    end
+  end
+end

  Added: test/command/test-table-remove.rb (+38 -0) 100644
===================================================================
--- /dev/null
+++ test/command/test-table-remove.rb    2012-11-25 19:08:00 +0900 (9598082)
@@ -0,0 +1,38 @@
+# -*- 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 TableRemoveCommandTest < Test::Unit::TestCase
+  class CommandLineTest < self
+    def test_ordered_arguments
+      name = "Users"
+
+      command = parse("table_remove", name)
+      assert_instance_of(Groonga::Command::TableRemove, command)
+      assert_equal({
+                     :name => name,
+                   },
+                   command.arguments)
+    end
+
+    private
+    def parse(command, *parameters)
+      command_line = "#{command} " + parameters.join(" ")
+      Groonga::Command::Parser.parse(command_line)
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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