[Groonga-commit] droonga/droonga-engine at 678d0de [master] Add unit test for ForwardBuffer

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 30 16:10:07 JST 2015


YUKI Hiroshi	2015-04-30 16:10:07 +0900 (Thu, 30 Apr 2015)

  New Revision: 678d0deb369048e6d09adee6723e285f03c071a1
  https://github.com/droonga/droonga-engine/commit/678d0deb369048e6d09adee6723e285f03c071a1

  Message:
    Add unit test for ForwardBuffer

  Added files:
    test/unit/test_forward_buffer.rb

  Added: test/unit/test_forward_buffer.rb (+42 -0) 100644
===================================================================
--- /dev/null
+++ test/unit/test_forward_buffer.rb    2015-04-30 16:10:07 +0900 (8f6470a)
@@ -0,0 +1,42 @@
+# Copyright (C) 2015 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# 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 "droonga/forward_buffer"
+
+class ForwardBufferTest < Test::Unit::TestCase
+  class ForwardBuffer < Droonga::ForwardBuffer
+    attr_writer :data_directory, :serf
+  end
+
+  def setup
+    setup_temporary_directory
+    @buffer = ForwardBuffer.new("node29:2929/droonga")
+    @buffer.data_directory = @temporary_directory
+    @buffer.serf = StubSerf.new
+  end
+
+  def teardown
+    teardown_temporary_directory
+  end
+
+  def test_empty
+    assert_true(@buffer.empty?)
+  end
+
+  def test_not_empty
+    @buffer.add({}, {})
+    assert_false(@buffer.empty?)
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index