about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-04 15:56:11 -0800
committerEric Wong <normalperson@yhbt.net>2010-12-04 15:56:11 -0800
commit76a68577ce61c02689ad450c054b69bf1a8d6f60 (patch)
tree0b4b3ecbc08eaba319401f4726b108c3a0a24cb4 /test
parent91774f18ae0bb044c24d75d275ccb90b1bd80ad0 (diff)
downloadruby-tdb-76a68577ce61c02689ad450c054b69bf1a8d6f60.tar.gz
TDB#clear maps to tdb_wipe_all and TDB#repack maps
to TDB#repack.
Diffstat (limited to 'test')
-rw-r--r--test/test_tdb.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_tdb.rb b/test/test_tdb.rb
index bd25203..64f34c0 100644
--- a/test/test_tdb.rb
+++ b/test/test_tdb.rb
@@ -267,4 +267,18 @@ class TestTdb < Test::Unit::TestCase
     TDB.constants.each { |const| values[TDB.const_get(const)] = const }
     assert_equal TDB.constants.size, values.size
   end
+
+  def test_clear
+    @tdb = TDB.new(nil)
+    @tdb["hello"] = "world"
+    assert_equal @tdb, @tdb.clear
+    assert ! @tdb.include?("hello")
+  end
+
+  def test_repack
+    @tdb = TDB.new(nil)
+    @tdb["hello"] = "world"
+    assert_equal @tdb, @tdb.repack
+    assert_equal "world", @tdb["hello"]
+  end if TDB.method_defined?(:repack)
 end