mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
4e2aa393ef
commit
d899d2d6be
1 changed files with 31 additions and 0 deletions
31
test/dbm/test_dbm.rb
Normal file
31
test/dbm/test_dbm.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue