summaryrefslogtreecommitdiffstats
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
commitaed7f6c500aaaccc2f756d52578ea0130904f571 (patch)
treecd71529eb6ceab9a9e0126a15691b9c1e0613b0a /test
parent13e0356483973615f382b033c8f0b28225481269 (diff)
downloadruby-aed7f6c500aaaccc2f756d52578ea0130904f571.tar.gz
ruby-aed7f6c500aaaccc2f756d52578ea0130904f571.tar.xz
ruby-aed7f6c500aaaccc2f756d52578ea0130904f571.zip
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: http://svn.ruby-lang.org/repos/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 000000000..f9198903a
--- /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