diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-27 05:50:21 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-27 05:50:21 +0000 |
commit | 9c8f03fac927d153f314be4259c5b7fc9b7fedc9 (patch) | |
tree | 7ca75b801b7b5a52b1221fec0fdbedcbde1c6e96 /test/rinda | |
parent | fdcc476e217eac6143e7d1585900955c7ceda737 (diff) | |
download | ruby-9c8f03fac927d153f314be4259c5b7fc9b7fedc9.tar.gz |
* lib/rinda/ring.rb: Announce RingServer for the same process.
[ruby-trunk - Bug #9163]
* test/rinda/test_rinda.rb: Tests for the above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rinda')
-rw-r--r-- | test/rinda/test_rinda.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/rinda/test_rinda.rb b/test/rinda/test_rinda.rb index 2bda9cc363..448c4fe02f 100644 --- a/test/rinda/test_rinda.rb +++ b/test/rinda/test_rinda.rb @@ -558,6 +558,40 @@ class TestRingServer < Test::Unit::TestCase @rs.shutdown end + def test_do_reply + called = nil + + callback = proc { |ts| + called = ts + } + + callback = DRb::DRbObject.new callback + + @ts.write [:lookup_ring, callback] + + @rs.do_reply + + Thread.pass until called + + assert_same @ts, called + end + + def test_do_reply_local + called = nil + + callback = proc { |ts| + called = ts + } + + @ts.write [:lookup_ring, callback] + + @rs.do_reply + + Thread.pass until called + + assert_same @ts, called + end + def test_make_socket_unicast v4 = @rs.make_socket('127.0.0.1') |