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
@ -98,18 +98,18 @@ if defined? DBM
|
|||||||
|
|
||||||
def test_dbmfile_suffix
|
def test_dbmfile_suffix
|
||||||
prefix = File.basename(@path)
|
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
|
case DBM::VERSION
|
||||||
when /\bNDBM\b/
|
when /\bNDBM\b/
|
||||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
assert_equal(%w[.dir .pag], suffixes)
|
||||||
when /\bGDBM\b/
|
when /\bGDBM\b/
|
||||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
assert_equal(%w[.dir .pag], suffixes)
|
||||||
when /\bBerkeley DB\b/
|
when /\bBerkeley DB\b/
|
||||||
assert_equal(["#{prefix}.db"], files)
|
assert_equal(%w[.db], suffixes)
|
||||||
when /\bQDBM\b/
|
when /\bQDBM\b/
|
||||||
assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files)
|
assert_equal(%w[.dir .pag], suffixes)
|
||||||
end
|
end
|
||||||
if files == ["#{prefix}.db"]
|
if suffixes == %w[.db]
|
||||||
assert_match(/\bBerkeley DB\b/, DBM::VERSION)
|
assert_match(/\bBerkeley DB\b/, DBM::VERSION)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user