summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-18 04:41:15 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-18 04:41:15 +0000
commit48a97f2c949a1ab22bc11c0be6b5da30a6ce6e72 (patch)
tree75729fb2f453c08089ce0fc2fec8fbfcfb0ee858 /test
parente7a1d4a309152582215fe23799491e31d802d90d (diff)
* test/dbm/test_dbm.rb (test_dbmfile_suffix): test dbm file suffix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/dbm/test_dbm.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index 79c8ae2150..582b0d7eaf 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -96,6 +96,21 @@ if defined? DBM
end
end
+ def test_dbmfile_suffix
+ prefix = File.basename(@path)
+ files = Dir.entries(@tmpdir).reject {|f| !f.start_with?(prefix) }.sort
+ case DBM::VERSION
+ when /\bNDBM\b/
+ assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
+ when /\bGDBM\b/
+ assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
+ when /\bBerkeley DB\b/
+ assert_equal(["#{prefix}.db"], files)
+ when /\bQDBM\b/
+ assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
+ end
+ end
+
def test_s_new_has_no_block
# DBM.new ignore the block
foo = true