about summary refs log tree commit homepage
path: root/test/test_tdb.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_tdb.rb')
-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