Skip to content

Commit

Permalink
Support "table_remove" command
Browse files Browse the repository at this point in the history
  • Loading branch information
Masafumi Yokoyama committed Feb 11, 2016
1 parent a00c944 commit 5aa19e3
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/groonga/client.rb
Expand Up @@ -219,6 +219,7 @@ def table_list(parameters={}, &block)
end

def table_remove(parameters, &block)
execute_command("table_remove", parameters, &block)
end

def table_rename(parameters, &block)
Expand Down
1 change: 1 addition & 0 deletions lib/groonga/client/response.rb
Expand Up @@ -38,3 +38,4 @@
require "groonga/client/response/status"
require "groonga/client/response/table_create"
require "groonga/client/response/table_list"
require "groonga/client/response/table_remove"
28 changes: 28 additions & 0 deletions lib/groonga/client/response/table_remove.rb
@@ -0,0 +1,28 @@
# Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

require "groonga/client/response/base"

module Groonga
class Client
module Response
class TableRemove < Base
Response.register("table_remove", self)
end
end
end
end

32 changes: 32 additions & 0 deletions test/response/test-table-remove.rb
@@ -0,0 +1,32 @@
# Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

require "response/helper"

class TestResponseTableRemove < Test::Unit::TestCase
class TestParseRawResponse < self
include TestResponseHelper

def test_table_remove
header = [0,1372430096.70991,0.000522851943969727]
body = true
raw_response = [header, body].to_json

response = parse_raw_response("table_remove", raw_response)
assert_equal(Groonga::Client::Response::TableRemove, response.class)
end
end
end
5 changes: 5 additions & 0 deletions test/test-command.rb
Expand Up @@ -56,4 +56,9 @@ def test_table_list
end
@client.table_list
end

def test_table_remove
mock(@client).execute_command("table_remove", :name => "Test")
@client.table_remove(:name => "Test")
end
end

0 comments on commit 5aa19e3

Please sign in to comment.