summaryrefslogtreecommitdiff
path: root/test/dl
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 18:22:52 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 18:22:52 +0000
commit40bae2f67c1160e1e59018c1003d014c60d1ee47 (patch)
tree4054071b8395cad9eeef0f18b129d9edff0d5a3b /test/dl
parent970944847455dae54072ade11b4f4247e4707681 (diff)
Run another process to avoid failure when objspace is already loaded
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_handle.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb
index cc4df49..e94083f 100644
--- a/test/dl/test_handle.rb
+++ b/test/dl/test_handle.rb
@@ -1,4 +1,5 @@
require_relative 'test_base'
+require_relative '../ruby/envutil'
module DL
class TestHandle < TestBase
@@ -158,9 +159,11 @@ module DL
# interface, below, should be used, since getpid() is a function and not a
# data object.)
# --- FreeBSD 8.0 dlsym(3)
- require 'objspace'
- handle = DL::Handle::NEXT
- assert_not_nil handle['Init_objspace']
+ out, err = capture_io do
+ require 'objspace'
+ print DL::Handle::NEXT.inspect
+ end
+ assert_match(/\A#<DL::Handle:0x[0-9a-f]+>\z/, out + err)
end
end unless /mswin|mingw/ =~ RUBY_PLATFORM