Kosuke Asami
null+****@clear*****
Wed Jan 13 17:30:56 JST 2016
Kosuke Asami 2013-07-16 13:31:34 +0900 (Tue, 16 Jul 2013) New Revision: 5a3071caf3ed3f88257c68fd51773ca4543eefec https://github.com/groonga/groonga-command/commit/5a3071caf3ed3f88257c68fd51773ca4543eefec Message: column_create: add with_weight 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:29:45 +0900 (2c3d209) +++ lib/groonga/command/column-create.rb 2013-07-16 13:31:34 +0900 (f5564b5) @@ -54,6 +54,10 @@ module Groonga def with_section? flags.include?("WITH_SECTION") end + + def with_weight? + flags.include?("WITH_WEIGHT") + end end end end Modified: test/command/test-column-create.rb (+15 -0) =================================================================== --- test/command/test-column-create.rb 2013-07-16 13:29:45 +0900 (084bffa) +++ test/command/test-column-create.rb 2013-07-16 13:31:34 +0900 (1ed139b) @@ -122,6 +122,21 @@ class ColumnCreateCommandTest < Test::Unit::TestCase command = parse({"flags" => data[:flags]}) assert_equal(data[:expected], command.with_section?) end + + data({ + "WITH_WEIGHT" => { + :expected => true, + :flags => "COLUMN_INDEX|WITH_WEIGHT", + }, + "other flag" => { + :expected => false, + :flags => "COLUMN_INDEX|WITH_POSITION", + } + }) + def test_with_weight?(data) + command = parse({"flags" => data[:flags]}) + assert_equal(data[:expected], command.with_weight?) + end end end end -------------- next part -------------- HTML����������������������������...Download