mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
which using fork on fork-less platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
507dd0e1b2
commit
60f2184922
4 changed files with 38 additions and 1 deletions
|
@ -58,6 +58,15 @@ if defined? GDBM
|
|||
end
|
||||
end
|
||||
|
||||
def have_fork?
|
||||
begin
|
||||
fork{}
|
||||
true
|
||||
rescue NotImplementedError
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def test_s_new_has_no_block
|
||||
# GDBM.new ignore the block
|
||||
foo = true
|
||||
|
@ -108,6 +117,7 @@ if defined? GDBM
|
|||
assert_equal(GDBM.open("tmptest_gdbm") { :foo }, :foo)
|
||||
end
|
||||
def test_s_open_lock
|
||||
return unless have_fork? # snip this test
|
||||
fork() {
|
||||
assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644))
|
||||
sleep 2
|
||||
|
@ -146,6 +156,7 @@ if defined? GDBM
|
|||
if not defined? GDBM::NOLOCK
|
||||
return
|
||||
end
|
||||
return unless have_fork? # snip this test
|
||||
|
||||
fork() {
|
||||
assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue