Kosuke Asami
null+****@clear*****
Tue Jul 16 13:34:09 JST 2013
Kosuke Asami 2013-07-16 13:34:09 +0900 (Tue, 16 Jul 2013) New Revision: 1e1612c75337a7ab972e634dcef04c59ad1972d5 https://github.com/groonga/groonga-command/commit/1e1612c75337a7ab972e634dcef04c59ad1972d5 Message: column_create: add with_position predicate Modified files: lib/groonga/command/column-create.rb test/command/test-column-create.rb Modified: lib/groonga/command/column-create.rb (+4 -0) =================================================================== --- lib/groonga/command/column-create.rb 2013-07-16 13:31:34 +0900 (f5564b5) +++ lib/groonga/command/column-create.rb 2013-07-16 13:34:09 +0900 (4a27b30) @@ -58,6 +58,10 @@ module Groonga def with_weight? flags.include?("WITH_WEIGHT") end + + def with_position? + flags.include?("WITH_POSITION") + end end end end Modified: test/command/test-column-create.rb (+15 -0) =================================================================== --- test/command/test-column-create.rb 2013-07-16 13:31:34 +0900 (1ed139b) +++ test/command/test-column-create.rb 2013-07-16 13:34:09 +0900 (8cabca8) @@ -137,6 +137,21 @@ class ColumnCreateCommandTest < Test::Unit::TestCase command = parse({"flags" => data[:flags]}) assert_equal(data[:expected], command.with_weight?) end + + data({ + "WITH_POSITION" => { + :expected => true, + :flags => "COLUMN_INDEX|WITH_POSITION", + }, + "other flag" => { + :expected => false, + :flags => "COLUMN_INDEX|WITH_SECTION", + } + }) + def test_with_position?(data) + command = parse({"flags" => data[:flags]}) + assert_equal(data[:expected], command.with_position?) + end end end end -------------- next part -------------- HTML����������������������������... ダウンロード