summaryrefslogtreecommitdiff
path: root/test/ruby/test_const.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-27 03:42:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-27 03:42:45 +0000
commitc158fccd2b1213ac69846a5a832cc1a1d4f2d431 (patch)
tree9ffb014392017ac57ab198b7bf7d48a29cfd9788 /test/ruby/test_const.rb
parent97cfffcdc64251660176cdc30a0408833d3d7af7 (diff)
downloadruby-c158fccd2b1213ac69846a5a832cc1a1d4f2d431.tar.gz
test_const.rb: use assert_warning
* test/ruby/test_const.rb (test_redefinition): should use assert_warning for warning message test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_const.rb')
-rw-r--r--test/ruby/test_const.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_const.rb b/test/ruby/test_const.rb
index 417cc7c961..2e3aea2f48 100644
--- a/test/ruby/test_const.rb
+++ b/test/ruby/test_const.rb
@@ -53,11 +53,14 @@ class TestConst < Test::Unit::TestCase
c.const_set(name, 1)
prev_line = __LINE__ - 1
EnvUtil.with_default_internal(Encoding::UTF_8) do
- assert_output(nil, <<-WARNING) {c.const_set(name, 2)}
+ assert_warning(<<-WARNING) {c.const_set(name, 2)}
#{__FILE__}:#{__LINE__-1}: warning: already initialized constant #{c}::#{name}
#{__FILE__}:#{prev_line}: warning: previous definition of #{name} was here
WARNING
end
+ end
+
+ def test_redefinition_memory_leak
code = <<-PRE
olderr = $stderr.dup
$stderr.reopen(File::NULL, "wb")