[Groonga-commit] groonga/groonga-command at 7dd06df [master] Add TableRename#name and TableRename#new_name

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Aug 8 11:36:05 JST 2016


Kouhei Sutou	2016-08-08 11:36:05 +0900 (Mon, 08 Aug 2016)

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

  Message:
    Add TableRename#name and TableRename#new_name

  Modified files:
    lib/groonga/command/table-rename.rb
    test/command/test-table-rename.rb

  Modified: lib/groonga/command/table-rename.rb (+15 -3)
===================================================================
--- lib/groonga/command/table-rename.rb    2016-08-08 11:33:02 +0900 (c88fe77)
+++ lib/groonga/command/table-rename.rb    2016-08-08 11:36:05 +0900 (7e09c78)
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2012  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2012-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
@@ -35,6 +33,20 @@ module Groonga
       end
 
       Command.register(command_name, self)
+
+      # @return [String] The table name to be renamed.
+      #
+      # @since 1.2.4
+      def name
+        self[:name]
+      end
+
+      # @return [String] The new table name.
+      #
+      # @since 1.2.4
+      def new_name
+        self[:new_name]
+      end
     end
   end
 end

  Modified: test/command/test-table-rename.rb (+17 -3)
===================================================================
--- test/command/test-table-rename.rb    2016-08-08 11:33:02 +0900 (82a5a74)
+++ test/command/test-table-rename.rb    2016-08-08 11:36:05 +0900 (8d2c5a5)
@@ -1,6 +1,4 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2012-2013  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2012-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
@@ -36,4 +34,20 @@ class TableRenameCommandTest < Test::Unit::TestCase
                    command.arguments)
     end
   end
+
+  class NameTest < self
+    def test_reader
+      command = table_rename_command({"name" => "Users"})
+      assert_equal("Users",
+                   command.name)
+    end
+  end
+
+  class NewNameTest < self
+    def test_reader
+      command = table_rename_command({"new_name" => "People"})
+      assert_equal("People",
+                   command.new_name)
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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