[Groonga-commit] ranguba/groonga-client at 30fec31 [master] Add Groonga::Client::Response::ColumnList::Column#sources alias

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 27 19:23:42 JST 2017


Kouhei Sutou	2017-10-27 19:23:42 +0900 (Fri, 27 Oct 2017)

  New Revision: 30fec31c7682c2afcfa2e2d35cb973ff8cdb3920
  https://github.com/ranguba/groonga-client/commit/30fec31c7682c2afcfa2e2d35cb973ff8cdb3920

  Message:
    Add Groonga::Client::Response::ColumnList::Column#sources alias

  Modified files:
    lib/groonga/client/response/column-list.rb
    test/response/test-column-list.rb

  Modified: lib/groonga/client/response/column-list.rb (+2 -0)
===================================================================
--- lib/groonga/client/response/column-list.rb    2017-10-27 18:11:31 +0900 (d0b3bf8)
+++ lib/groonga/client/response/column-list.rb    2017-10-27 19:23:42 +0900 (b6ff4aa)
@@ -95,6 +95,8 @@ module Groonga
           def index?
             flags.include?("COLUMN_INDEX")
           end
+
+          alias_method :sources, :source
         end
       end
     end

  Modified: test/response/test-column-list.rb (+30 -0)
===================================================================
--- test/response/test-column-list.rb    2017-10-27 18:11:31 +0900 (68d171d)
+++ test/response/test-column-list.rb    2017-10-27 19:23:42 +0900 (192a993)
@@ -137,6 +137,36 @@ class TestResponseColumnList < Test::Unit::TestCase
         end
       end
     end
+
+    class TestSource < self
+      def create_response(sources)
+        columns = [
+          [
+            256,
+            "content",
+            "/tmp/test.db.0000100",
+            "var",
+            "COLUMN_INDEX|WITH_POSITION|PERSISTENT",
+            "Memos",
+            "ShortText",
+            sources,
+          ]
+        ]
+        super(columns)
+      end
+
+      def test_source
+        sources = ["Memos.title", "Memos.content"]
+        response = create_response(sources)
+        assert_equal(sources, response[0].source)
+      end
+
+      def test_sources
+        sources = ["Memos.title", "Memos.content"]
+        response = create_response(sources)
+        assert_equal(sources, response[0].sources)
+      end
+    end
   end
 end
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171027/29e77e0b/attachment-0001.htm 



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