[Groonga-commit] groonga/groonga-command at c1aeb9f [master] Add ColumnRename#table, ColumnRename#name and ColumnRename#new_name

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Aug 8 11:32:04 JST 2016


Kouhei Sutou	2016-08-08 11:32:04 +0900 (Mon, 08 Aug 2016)

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

  Message:
    Add ColumnRename#table, ColumnRename#name and ColumnRename#new_name

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

  Modified: lib/groonga/command/column-rename.rb (+22 -3)
===================================================================
--- lib/groonga/command/column-rename.rb    2016-08-08 11:31:22 +0900 (1269764)
+++ lib/groonga/command/column-rename.rb    2016-08-08 11:32:04 +0900 (2f0f48b)
@@ -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
@@ -36,6 +34,27 @@ module Groonga
       end
 
       Command.register(command_name, self)
+
+      # @return [String] The table name of the column.
+      #
+      # @since 1.2.4
+      def table
+        self[:table]
+      end
+
+      # @return [String] The current column name.
+      #
+      # @since 1.2.4
+      def name
+        self[:name]
+      end
+
+      # @return [String] The new column name.
+      #
+      # @since 1.2.4
+      def new_name
+        self[:new_name]
+      end
     end
   end
 end

  Modified: test/command/test-column-rename.rb (+25 -3)
===================================================================
--- test/command/test-column-rename.rb    2016-08-08 11:31:22 +0900 (2addd12)
+++ test/command/test-column-rename.rb    2016-08-08 11:32:04 +0900 (50c6343)
@@ -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
@@ -38,4 +36,28 @@ class ColumnRenameCommandTest < Test::Unit::TestCase
                    command.arguments)
     end
   end
+
+  class TableTest < self
+    def test_reader
+      command = column_rename_command({"table" => "Logs"})
+      assert_equal("Logs",
+                   command.table)
+    end
+  end
+
+  class NameTest < self
+    def test_reader
+      command = column_rename_command({"name" => "message"})
+      assert_equal("message",
+                   command.name)
+    end
+  end
+
+  class NewNameTest < self
+    def test_reader
+      command = column_rename_command({"new_name" => "content"})
+      assert_equal("content",
+                   command.new_name)
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Descargar 



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