Kouhei Sutou 2018-10-23 17:16:34 +0900 (Tue, 23 Oct 2018) Revision: 3cafeb59cdb1b44bfcf99b1db9804adc106e9db7 https://github.com/groonga/groonga-command/commit/3cafeb59cdb1b44bfcf99b1db9804adc106e9db7 Message: Add Delete#table Modified files: lib/groonga/command/delete.rb test/command/test-delete.rb Modified: lib/groonga/command/delete.rb (+5 -3) =================================================================== --- lib/groonga/command/delete.rb 2018-10-23 17:14:26 +0900 (939e977) +++ lib/groonga/command/delete.rb 2018-10-23 17:16:34 +0900 (5041330) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2012 Kouhei Sutou <kou****@clear*****> +# Copyright (C) 2012-2018 Kouhei Sutou <kou****@clear*****> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -37,6 +35,10 @@ module Groonga end Command.register(command_name, self) + + def table + @table ||= self[:table] + end end end end Modified: test/command/test-delete.rb (+13 -3) =================================================================== --- test/command/test-delete.rb 2018-10-23 17:14:26 +0900 (f69a2da) +++ test/command/test-delete.rb 2018-10-23 17:16:34 +0900 (42a6f5b) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2012-2013 Kouhei Sutou <kou****@clear*****> +# Copyright (C) 2012-2018 Kouhei Sutou <kou****@clear*****> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -40,4 +38,16 @@ class DeleteCommandTest < Test::Unit::TestCase command.arguments) end end + + class TableTest < self + def test_nil + command = delete_command + assert_nil(command.table) + end + + def test_specified + command = delete_command(:table => "Users") + assert_equal("Users", command.table) + end + end end -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181023/bdabc54e/attachment-0001.html>