summaryrefslogtreecommitdiff
path: root/test/drb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-22 03:53:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-22 03:53:41 +0000
commitf136a3225e5fdd37961b8ed0e29c96e4a40f0d64 (patch)
treed33dfde2fb79afba368732768bf4f6bdf0e90480 /test/drb
parent4650c38d8b157667c6e9532174297f9e72bc4c34 (diff)
* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
ignore tests which raised LoadError. * test/drb/drbtest.rb, test/ruby/test_beginendblock.rb, test/ruby/test_system.rb: avoid requiring same file twice. * test/drb/test_drbssl.rb, test/drb/test_drbunix.rb: should not use ARGV unless invoked directly. do not create test cases unless required libraries are available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb')
-rw-r--r--test/drb/drbtest.rb17
-rw-r--r--test/drb/test_drb.rb3
-rw-r--r--test/drb/test_drbssl.rb6
-rw-r--r--test/drb/test_drbunix.rb7
4 files changed, 19 insertions, 14 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index 5cdcd25..cc3c4d4 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -1,10 +1,9 @@
-require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
require 'test/unit'
require 'drb/drb'
require 'drb/extservm'
require 'timeout'
-
-require "#{File.dirname(File.expand_path(__FILE__))}/../ruby/envutil"
+$:.unshift(File.expand_path("../../ruby", __FILE__))
+require 'envutil'
class DRbService
@@manager = DRb::ExtServManager.new
@@ -68,11 +67,11 @@ module DRbCore
ro = DRbObject.new(nil, 'druby://localhost:12345')
assert_equal('druby://localhost:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)
-
+
ro = DRbObject.new_with_uri('druby://localhost:12345')
assert_equal('druby://localhost:12345', ro.__drburi)
assert_equal(nil, ro.__drbref)
-
+
ro = DRbObject.new_with_uri('druby://localhost:12345?foobar')
assert_equal('druby://localhost:12345', ro.__drburi)
assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref)
@@ -88,7 +87,7 @@ module DRbCore
def test_01_02_loop
onecky = Onecky.new('3')
- 50.times do
+ 50.times do
assert_equal(6, @there.sample(onecky, 1, 2))
ary = @there.to_a
assert_kind_of(DRb::DRbObject, ary)
@@ -166,14 +165,14 @@ module DRbCore
begin
@there.method_missing(:eval)
rescue NameError
- assert_match(/^private method `eval'/, $!.message)
+ assert_match(/^private method \`eval\'/, $!.message)
end
}
assert_nothing_raised() {
begin
@there.method_missing(:undefined_method_test)
rescue NameError
- assert_match(/^undefined method `undefined_method_test'/, $!.message)
+ assert_match(/^undefined method \`undefined_method_test\'/, $!.message)
end
}
assert_raises(SecurityError) do
@@ -184,7 +183,7 @@ module DRbCore
def test_08_here
ro = DRbObject.new(nil, DRb.uri)
assert_kind_of(String, ro.to_s)
-
+
ro = DRbObject.new_with_uri(DRb.uri)
assert_kind_of(String, ro.to_s)
end
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index 213c70f..a3c259b 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -1,4 +1,5 @@
-require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
+$:.unshift(File.dirname(File.expand_path(__FILE__)))
+require 'drbtest'
class TestDRbCore < Test::Unit::TestCase
include DRbCore
diff --git a/test/drb/test_drbssl.rb b/test/drb/test_drbssl.rb
index 6e2e0b1..0ca177f 100644
--- a/test/drb/test_drbssl.rb
+++ b/test/drb/test_drbssl.rb
@@ -1,4 +1,5 @@
-require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
+$:.unshift(File.dirname(File.expand_path(__FILE__)))
+require 'drbtest'
require 'drb/ssl'
class DRbSSLService < DRbService
@@ -22,7 +23,8 @@ class DRbSSLService < DRbService
[ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ]
end
- @server = DRb::DRbServer.new(ARGV.shift || 'drbssl://:0', @@manager, config)
+ uri = ARGV.shift if $0 == __FILE__
+ @server = DRb::DRbServer.new(uri || 'drbssl://:0', @@manager, config)
end
class TestDRbSSLCore < Test::Unit::TestCase
diff --git a/test/drb/test_drbunix.rb b/test/drb/test_drbunix.rb
index 1aaaffe..e05637a 100644
--- a/test/drb/test_drbunix.rb
+++ b/test/drb/test_drbunix.rb
@@ -1,11 +1,14 @@
-require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
+$:.unshift(File.dirname(File.expand_path(__FILE__)))
+require 'drbtest'
require 'drb/unix'
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, {})
+
+ uri = ARGV.shift if $0 == __FILE__
+ @server = DRb::DRbServer.new(uri || 'drbunix:', @@manager, {})
end
class TestDRbUNIXCore < Test::Unit::TestCase