summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 09:39:43 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 09:39:43 +0000
commit1e8a6745b088100bfe6cc7f004e6dbd4558ad47c (patch)
treedb09e8856a62b07ed14308bf2ccbc9c4e359e3c2 /test
parentc6252206717f4cfa376f9731b5535b12ea71fece (diff)
merges r21084 from trunk into ruby_1_9_1.
* vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of calling id when NODE_CFUNC or NODE_BMETHOD. fixes Bug #632 [ruby-core:19282]. * vm_eval.c (vm_call0, vm_call_super): ditto. * vm_method.c (rb_add_method, rb_alias): store original id in nd_file field of NODE_METHOD. * test/stringio/test_stringio.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 8f0dc8702c..98cf84e00f 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -379,4 +379,19 @@ class TestStringIO < Test::Unit::TestCase
assert_equal(4, f.size)
end
+ # This test is should in ruby/test_method.rb
+ # However this test depends on stringio library,
+ # we write it here.
+ class C < StringIO
+ alias old_init initialize
+ attr_reader :foo
+ def initialize
+ @foo = :ok
+ old_init
+ end
+ end
+
+ def test_method
+ assert_equal(:ok, C.new.foo, 'Bug #632 [ruby-core:19282]')
+ end
end