1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2003-10-22 03:53:41 +00:00
parent 4650c38d8b
commit f136a3225e
8 changed files with 36 additions and 16 deletions

View file

@ -1,3 +1,15 @@
Wed Oct 22 12:53:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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.
Wed Oct 22 02:31:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (ruby_cleanup): should not ignore exit_value in END

View file

@ -75,6 +75,7 @@ module Test
require(name)
end
find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
rescue LoadError, SystemExit
ensure
$:.replace(loadpath)
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,6 +1,7 @@
require 'test/unit'
require 'tempfile'
require "#{File.dirname(File.expand_path(__FILE__))}/envutil"
$:.unshift(File.dirname(File.expand_path(__FILE__)))
require 'envutil'
class TestBeginEndBlock < Test::Unit::TestCase
DIR = File.dirname(File.expand_path(__FILE__))

View file

@ -1,5 +1,6 @@
require 'test/unit'
require "#{File.dirname(File.expand_path(__FILE__))}/envutil"
$:.unshift(File.dirname(File.expand_path(__FILE__)))
require 'envutil'
$KCODE = 'none'