diff options
author | seki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-27 15:18:22 +0000 |
---|---|---|
committer | seki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-27 15:18:22 +0000 |
commit | 190bc7ae0e7346cc572129eea314c06c1c51cfe8 (patch) | |
tree | a23fddc13c30173b19a80f23821fb58c3a80d5ca /test/drb | |
parent | eda3f1be206aa86cb2fb4f795fd33b1df1909cb0 (diff) | |
download | ruby-190bc7ae0e7346cc572129eea314c06c1c51cfe8.tar.gz |
fix [Bug #4409]. add DRbServer#here?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb')
-rw-r--r-- | test/drb/drbtest.rb | 2 | ||||
-rw-r--r-- | test/drb/test_drb.rb | 16 | ||||
-rw-r--r-- | test/drb/ut_eq.rb | 30 |
3 files changed, 47 insertions, 1 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb index a5222dec60..fe39a6e5b8 100644 --- a/test/drb/drbtest.rb +++ b/test/drb/drbtest.rb @@ -14,7 +14,7 @@ class DRbService DRb::ExtServManager.command[nm] = "#{@@ruby} \"#{dir}/#{nm}\"" end - %w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb).each do |nm| + %w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb ut_eq.rb).each do |nm| add_service_command(nm) end @server = @@server = DRb::DRbServer.new('druby://localhost:0', @@manager, {}) diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb index 990cb825cf..8ab00ec2a0 100644 --- a/test/drb/test_drb.rb +++ b/test/drb/test_drb.rb @@ -299,3 +299,19 @@ class TestDRbLarge < Test::Unit::TestCase assert_kind_of(StandardError, exception) end end + +class TestBug4409 < Test::Unit::TestCase + def setup + @ext = DRbService.ext_service('ut_eq.rb') + @there = @ext.front + end + + def teardown + @ext.stop_service if @ext + end + + def test_bug4409 + foo = @there.foo + assert(@there.foo?(foo)) + end +end diff --git a/test/drb/ut_eq.rb b/test/drb/ut_eq.rb new file mode 100644 index 0000000000..10dc85698c --- /dev/null +++ b/test/drb/ut_eq.rb @@ -0,0 +1,30 @@ +require 'drb/drb' +require 'drb/extserv' + +class Foo + include DRbUndumped +end + +class Bar + include DRbUndumped + def initialize + @foo = Foo.new + end + attr_reader :foo + + def foo?(foo) + @foo == foo + end +end + +if __FILE__ == $0 + def ARGV.shift + it = super() + raise "usage: #{$0} <uri> <name>" unless it + it + end + + DRb.start_service('druby://:0', Bar.new) + es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) + DRb.thread.join +end |