summaryrefslogtreecommitdiff
path: root/test/dbm
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-04 02:24:54 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-04 02:24:54 +0000
commit60f2184922eedceb720307d25714bc9eb146b056 (patch)
treefcaa6bb519f44e88b8d8036196e36ec2899ae5f5 /test/dbm
parent507dd0e1b2db570c16c4711fbd86f1fdd9a6fc5a (diff)
* 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
Diffstat (limited to 'test/dbm')
-rw-r--r--test/dbm/test_dbm.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index a5e2c4f4a1..9d63bdf5b3 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -61,6 +61,15 @@ if defined? DBM
end
end
+ def have_fork?
+ begin
+ fork{}
+ true
+ rescue NotImplementedError
+ false
+ end
+ end
+
def test_s_new_has_no_block
# DBM.new ignore the block
foo = true
@@ -77,6 +86,7 @@ if defined? DBM
assert_equal(DBM.open("tmptest_dbm") { :foo }, :foo)
end
def test_s_open_lock
+ return unless have_fork? # snip this test
fork() {
assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644))
sleep 2
@@ -115,6 +125,7 @@ if defined? DBM
if not defined? DBM::NOLOCK
return
end
+ return unless have_fork? # snip this test
fork() {
assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644,