mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
simplify a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fc0111cce1
commit
90cc116431
1 changed files with 6 additions and 6 deletions
|
@ -98,18 +98,18 @@ if defined? DBM
|
|||
|
||||
def test_dbmfile_suffix
|
||||
prefix = File.basename(@path)
|
||||
files = Dir.entries(@tmpdir).reject {|f| !f.start_with?(prefix) }.sort
|
||||
suffixes = Dir.entries(@tmpdir).grep(/\A#{Regexp.escape prefix}/) { $' }.sort
|
||||
case DBM::VERSION
|
||||
when /\bNDBM\b/
|
||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
||||
assert_equal(%w[.dir .pag], suffixes)
|
||||
when /\bGDBM\b/
|
||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
||||
assert_equal(%w[.dir .pag], suffixes)
|
||||
when /\bBerkeley DB\b/
|
||||
assert_equal(["#{prefix}.db"], files)
|
||||
assert_equal(%w[.db], suffixes)
|
||||
when /\bQDBM\b/
|
||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
||||
assert_equal(%w[.dir .pag], suffixes)
|
||||
end
|
||||
if files == ["#{prefix}.db"]
|
||||
if suffixes == %w[.db]
|
||||
assert_match(/\bBerkeley DB\b/, DBM::VERSION)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue