summaryrefslogtreecommitdiff
path: root/test/stringio
diff options
context:
space:
mode:
Diffstat (limited to 'test/stringio')
-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