[groonga-commit:3347] ranguba/rroonga [master] share common routine of creating table for test. refs #938
null+ranguba at clear-code.com
null+ranguba at clear-code.com
Tue May 31 00:46:16 EDT 2011
yoshihara haruka 2011-05-31 04:46:16 +0000 (Tue, 31 May 2011)
New Revision: 8e7e7877c7debbbead482354923027ab7a99e3bc
Log:
share common routine of creating table for test. refs #938
Modified files:
test/test-index-cursor.rb
Modified: test/test-index-cursor.rb (+3 -21)
===================================================================
--- test/test-index-cursor.rb 2011-05-31 04:41:11 +0000 (f19b835)
+++ test/test-index-cursor.rb 2011-05-31 04:46:16 +0000 (9309a8f)
@@ -39,29 +39,11 @@ class IndexCursorTest < Test::Unit::TestCase
end
def test_enumerable
- Groonga::Schema.define do |schema|
- schema.create_table("Articles") do |table|
- table.text("content")
- end
-
- schema.create_table("Terms",
- :type => :hash,
- :default_tokenizer => :bigram_split_symbol_alpha) do |table|
- table.index("Articles.content")
- end
- end
-
- articles = Groonga["Articles"]
- terms = Groonga["Terms"]
- content_index = Groonga["Terms.Articles_content"]
-
- articles.add(:content => "l")
- articles.add(:content => "ll")
- articles.add(:content => "hello")
+ setup_table
postings = []
- terms.open_cursor do |table_cursor|
- content_index.open_cursor(table_cursor) do |cursor|
+ @terms.open_cursor do |table_cursor|
+ @content_index.open_cursor(table_cursor) do |cursor|
postings = cursor.collect do |posting|
posting.to_hash
end
More information about the groonga-commit
mailing list