summaryrefslogtreecommitdiff
path: root/test/test_delegate.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-07 05:11:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-07 05:11:10 +0000
commit1d10aa8bfc98a42522716f71aae60cb70498a6e6 (patch)
tree248f0b7c17d48a551f7a69399f241bfca923362f /test/test_delegate.rb
parent1c2ef610358af33f9ded3086aa2d70aac03dcac5 (diff)
* marshal.c (w_object): reverted r26007. [ruby-dev:39845]
* test/test_delegate.rb (test_marshal): moved from test_marshal.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_delegate.rb')
-rw-r--r--test/test_delegate.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_delegate.rb b/test/test_delegate.rb
index aecabe1..bce1231 100644
--- a/test/test_delegate.rb
+++ b/test/test_delegate.rb
@@ -51,4 +51,20 @@ class TestDelegateClass < Test::Unit::TestCase
assert_equal(:m, SimpleDelegator.new(Foo.new).m)
assert_equal(:m, Bar.new(Foo.new).m)
end
+
+ class IV < DelegateClass(Integer)
+ attr_accessor :var
+
+ def initialize
+ @var = 1
+ end
+ end
+
+ def test_marshal
+ bug1744 = '[ruby-core:24211]'
+ c = IV.new
+ assert_equal(1, c.var)
+ d = Marshal.load(Marshal.dump(c))
+ assert_equal(1, d.var, bug1744)
+ end
end