summaryrefslogtreecommitdiff
path: root/test/drb/test_drbunix.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-21 14:42:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-21 14:42:15 +0000
commit06d9340f2e1491697625afbf1fe94137e252319c (patch)
treed3af38d76c2d5e8ce896c7ea146941ccd7f0c1e6 /test/drb/test_drbunix.rb
parent8af34b7b33714eeb0f0dead1ce79a98b780ddb22 (diff)
* eval.c (ruby_cleanup): call finalizers and exit procs before
terminating threads. * eval.c (ruby_cleanup): preserve ruby_errinfo before ruby_finalize_0(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb/test_drbunix.rb')
-rw-r--r--test/drb/test_drbunix.rb31
1 files changed, 15 insertions, 16 deletions
diff --git a/test/drb/test_drbunix.rb b/test/drb/test_drbunix.rb
index d1fa63dd772..1aaaffe359a 100644
--- a/test/drb/test_drbunix.rb
+++ b/test/drb/test_drbunix.rb
@@ -1,12 +1,17 @@
-require 'test_drb'
+require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
+require 'drb/unix'
-class TestService
- @@scripts = %w(ut_drb_drbunix.rb ut_array_drbunix.rb)
+class DRbUNIXService < DRbService
+ %w(ut_drb_drbunix.rb ut_array_drbunix.rb).each do |nm|
+ DRb::ExtServManager.command[nm] = "#{@@ruby} #{@@dir}/#{nm}"
+ end
+ @server = DRb::DRbServer.new(ARGV.shift || 'drbunix:', @@manager, {})
end
-class DRbXCoreTest < DRbCoreTest
+class TestDRbUNIXCore < Test::Unit::TestCase
+ include DRbCore
def setup
- @ext = $manager.service('ut_drb_drbunix.rb')
+ @ext = DRbUNIXService.manager.service('ut_drb_drbunix.rb')
@there = @ext.front
end
@@ -21,26 +26,20 @@ class DRbXCoreTest < DRbCoreTest
def test_06_timeout
ten = Onecky.new(3)
- assert_exception(TimeoutError) do
+ assert_raises(TimeoutError) do
@there.do_timeout(ten)
end
- assert_exception(TimeoutError) do
+ assert_raises(TimeoutError) do
@there.do_timeout(ten)
end
sleep 3
end
end
-class DRbXAryTest < DRbAryTest
+class TestDRbUNIXAry < Test::Unit::TestCase
+ include DRbAry
def setup
- @ext = $manager.service('ut_array_drbunix.rb')
+ @ext = DRbUNIXService.manager.service('ut_array_drbunix.rb')
@there = @ext.front
end
end
-
-if __FILE__ == $0
- $testservice = TestService.new(ARGV.shift || 'drbunix:')
- $manager = $testservice.manager
- RUNIT::CUI::TestRunner.run(DRbXCoreTest.suite)
- RUNIT::CUI::TestRunner.run(DRbXAryTest.suite)
-end