Skip to content

Commit

Permalink
Enable "value_type" parameter to "table_create" command
Browse files Browse the repository at this point in the history
  • Loading branch information
Kosuke Asami committed Jul 11, 2013
1 parent 4ace993 commit a23a662
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/droonga/plugin/groonga/table_create.rb
Expand Up @@ -38,6 +38,7 @@ def parse_request(request)
options = {}
options.merge!(parse_flags(request))
options.merge!(parse_key_type(request))
options.merge!(parse_value_type(request))
options
end

Expand Down Expand Up @@ -70,6 +71,12 @@ def parse_key_type(request)
options[:key_type] = request["key_type"] if request["key_type"]
options
end

def parse_value_type(request)
options = {}
options[:value_type] = request["value_type"] if request["value_type"]
options
end
end
end
end
13 changes: 13 additions & 0 deletions test/plugin/groonga/test_table_create.rb
Expand Up @@ -106,4 +106,17 @@ def test_key_type
SCHEMA
end
end

class ValueTypeTest < self
def test_value_type
request = {
"name" => "Books",
"value_type" => "Int32",
}
@handler.table_create(request)
assert_equal(<<-SCHEMA, dump)
table_create Books TABLE_HASH_KEY --key_type ShortText --value_type Int32
SCHEMA
end
end
end

0 comments on commit a23a662

Please sign in to comment.