[Groonga-commit] droonga/droonga-message-pack-packer-ruby at d096459 [master] Add test for #clear

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Sep 7 22:57:16 JST 2014


Kouhei Sutou	2014-09-07 22:57:16 +0900 (Sun, 07 Sep 2014)

  New Revision: d0964593ee524c3ba12ad48592f79af0026c658f
  https://github.com/droonga/droonga-message-pack-packer-ruby/commit/d0964593ee524c3ba12ad48592f79af0026c658f

  Message:
    Add test for #clear

  Modified files:
    test/test-packer.rb

  Modified: test/test-packer.rb (+19 -0)
===================================================================
--- test/test-packer.rb    2014-09-07 22:54:03 +0900 (2180ba7)
+++ test/test-packer.rb    2014-09-07 22:57:16 +0900 (6fb2e20)
@@ -96,4 +96,23 @@ class PackerTest < Test::Unit::TestCase
   def unpack(msgpack)
     MessagePack.unpack(msgpack)
   end
+
+  class ClearTest < self
+    def setup
+      @packer = Droonga::MessagePackPacker.new
+    end
+
+    def test_empty
+      assert_equal("", @packer.to_s)
+      @packer.clear
+      assert_equal("", @packer.to_s)
+    end
+
+    def test_have_content
+      @packer.pack("string")
+      assert_equal("string", unpack(@packer.to_s))
+      @packer.clear
+      assert_equal("", @packer.to_s)
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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