summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 09:39:13 +0000
committer(no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-07 09:39:13 +0000
commitd899d2d6beee0391805e795333b0e93ec89c5cd2 (patch)
treecd71529eb6ceab9a9e0126a15691b9c1e0613b0a /test
parent4e2aa393ef6b1432774df238aaaa8baaae40e3c6 (diff)
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/dbm/test_dbm.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
new file mode 100644
index 0000000000..f9198903a3
--- /dev/null
+++ b/test/dbm/test_dbm.rb
@@ -0,0 +1,31 @@
+require 'test/unit/testsuite'
+require 'test/unit/testcase'
+
+begin
+ require 'dbm'
+rescue LoadError
+end
+
+if defined? DBM
+ require 'tmpdir'
+ require 'fileutils'
+
+ class TestDBM < Test::Unit::TestCase
+ TMPROOT = "#{Dir.tmpdir}/ruby-gdbm.#{$$}"
+
+ def setup
+ Dir.mkdir TMPROOT
+ end
+
+ def teardown
+ FileUtils.rm_rf TMPROOT if File.directory?(TMPROOT)
+ end
+
+ def test_freeze
+ DBM.open("#{TMPROOT}/a.dbm") {|d|
+ d.freeze
+ assert_raises(TypeError) { d["k"] = "v" }
+ }
+ end
+ end
+end