[前][次][番号順一覧][スレッド一覧]

ruby-changes:36517

From: nobu <ko1@a...>
Date: Thu, 27 Nov 2014 12:43:21 +0900 (JST)
Subject: [ruby-changes:36517] nobu:r48599 (trunk): test_const.rb: use assert_warning

nobu	2014-11-27 12:42:45 +0900 (Thu, 27 Nov 2014)

  New Revision: 48599

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48599

  Log:
    test_const.rb: use assert_warning
    
    * test/ruby/test_const.rb (test_redefinition): should use
      assert_warning for warning message test.

  Modified files:
    trunk/test/ruby/test_const.rb
Index: test/ruby/test_const.rb
===================================================================
--- test/ruby/test_const.rb	(revision 48598)
+++ test/ruby/test_const.rb	(revision 48599)
@@ -53,11 +53,14 @@ class TestConst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_const.rb#L53
     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")

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]