ruby-changes:55514
From: Masatoshi <ko1@a...>
Date: Thu, 25 Apr 2019 01:09:07 +0900 (JST)
Subject: [ruby-changes:55514] Masatoshi SEKI:68e3f8192b (trunk): add DRbObject dereference test (Preparation for investigation of Bug #15711)
Masatoshi SEKI 2019-04-25 01:08:54 +0900 (Thu, 25 Apr 2019) New Revision: 68e3f8192b https://git.ruby-lang.org/ruby.git/commit/?id=3D68e3f8192b Log: add DRbObject dereference test (Preparation for investigation of Bug = #15711) Added files: test/drb/test_drbobject.rb= From 68e3f8192b6df3ee1759bef7725e958aa3e72c3d Mon Sep 17 00:00:00 2001 From: Masatoshi SEKI <m_seki@m...> Date: Thu, 25 Apr 2019 01:08:54 +0900 Subject: add DRbObject dereference test (Preparation for investigation of Bug #15711) diff --git a/test/drb/test_drbobject.rb b/test/drb/test_drbobject.rb new file mode 100644 index 0000000..3c7b0c1 --- /dev/null +++ b/test/drb/test_drbobject.rb @@ -0,0 +1,47 @@ https://github.com/ruby/ruby/blob/trunk/#L1 +require 'test/unit' +require 'drb' +require 'drb/timeridconv' + +module DRbObjectTest + class Foo + def initialize + @foo = 'foo' + end + end + + def teardown + DRb.stop_service + end + + def drb_eq(obj) + proxy = DRbObject.new(obj) + assert_equal(obj, DRb.to_obj(proxy.__drbref)) + end + + def test_DRbObject_id_dereference + drb_eq(Foo.new) + drb_eq(Foo) + drb_eq(File) + drb_eq(Enumerable) + drb_eq(nil) + drb_eq(1) + drb_eq($stdout) + drb_eq([]) + end +end + +class TestDRbObject < Test::Unit::TestCase + include DRbObjectTest + + def setup + DRb.start_service + end +end + +class TestDRbObjectTimerIdConv < Test::Unit::TestCase + include DRbObjectTest + + def setup + DRb.start_service(nil, nil, {:idconv => DRb::TimerIdConv.new}) + end +end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/