Masafumi Yokoyama
null+****@clear*****
Thu Feb 11 22:32:41 JST 2016
Masafumi Yokoyama 2016-02-11 22:32:41 +0900 (Thu, 11 Feb 2016) New Revision: 5aa19e3bebd7c2a445a3e8b306d594d80c2f530e https://github.com/ranguba/groonga-client/commit/5aa19e3bebd7c2a445a3e8b306d594d80c2f530e Merged b3a4eab: Merge pull request #7 from ranguba/support-table-remove-command Message: Support "table_remove" command Added files: lib/groonga/client/response/table_remove.rb test/response/test-table-remove.rb Modified files: lib/groonga/client.rb lib/groonga/client/response.rb test/test-command.rb Modified: lib/groonga/client.rb (+1 -0) =================================================================== --- lib/groonga/client.rb 2016-02-11 21:56:14 +0900 (16ffa18) +++ lib/groonga/client.rb 2016-02-11 22:32:41 +0900 (fc20875) @@ -219,6 +219,7 @@ module Groonga end def table_remove(parameters, &block) + execute_command("table_remove", parameters, &block) end def table_rename(parameters, &block) Modified: lib/groonga/client/response.rb (+1 -0) =================================================================== --- lib/groonga/client/response.rb 2016-02-11 21:56:14 +0900 (adab1ef) +++ lib/groonga/client/response.rb 2016-02-11 22:32:41 +0900 (c7a1d3b) @@ -38,3 +38,4 @@ require "groonga/client/response/select" require "groonga/client/response/status" require "groonga/client/response/table_create" require "groonga/client/response/table_list" +require "groonga/client/response/table_remove" Added: lib/groonga/client/response/table_remove.rb (+28 -0) 100644 =================================================================== --- /dev/null +++ lib/groonga/client/response/table_remove.rb 2016-02-11 22:32:41 +0900 (e0fa591) @@ -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 + Added: test/response/test-table-remove.rb (+32 -0) 100644 =================================================================== --- /dev/null +++ test/response/test-table-remove.rb 2016-02-11 22:32:41 +0900 (a088420) @@ -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 Modified: test/test-command.rb (+5 -0) =================================================================== --- test/test-command.rb 2016-02-11 21:56:14 +0900 (3a1fddf) +++ test/test-command.rb 2016-02-11 22:32:41 +0900 (a26e71e) @@ -56,4 +56,9 @@ class TestCommand < Test::Unit::TestCase end @client.table_list end + + def test_table_remove + mock(@client).execute_command("table_remove", :name => "Test") + @client.table_remove(:name => "Test") + end end -------------- next part -------------- HTML����������������������������... Download