https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112010-01-25T22:52:43ZRuby Issue Tracking SystemRuby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=78472010-01-25T22:52:43ZEregon (Benoit Daloze)
<ul></ul><p>=begin</p>
<blockquote>
<p>This leads to a loss of a valuable chance of test. It is good for<br>
test/unit to detect and warn such a redefinition.</p>
</blockquote>
<p>I think you can already see them with warning enabled:<br>
(in Ruby 1.9.2)<br>
test.rb:163: warning: method redefined; discarding old test_one<br>
test.rb:160: warning: previous definition of test_one was here<br>
(in 1.8.7)<br>
test.rb:163: warning: method redefined; discarding old test_one</p>
<p>B.D.</p>
<p>=end</p> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=78492010-01-25T23:15:38Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>=begin<br>
2010/1/25 Benoit Daloze <a href="mailto:eregontp@gmail.com" class="email">eregontp@gmail.com</a>:</p>
<blockquote>
<blockquote>
<p>This leads to a loss of a valuable chance of test. It is good for<br>
test/unit to detect and warn such a redefinition.</p>
</blockquote>
<p>I think you can already see them with warning enabled:<br>
(in Ruby 1.9.2)<br>
test.rb:163: warning: method redefined; discarding old test_one<br>
test.rb:160: warning: previous definition of test_one was here<br>
(in 1.8.7)<br>
test.rb:163: warning: method redefined; discarding old test_one</p>
</blockquote>
<p>The warning is very forgetful. It is waste of time and intelligence<br>
for all test/unit users to enable the warning. In addition, method<br>
redefinition is not always wrong.</p>
<p>But, it is reasonable to enable all warning during test. If so, it is<br>
also good for test/unit to enable warning by default, I think.</p>
<p>--<br>
Yusuke ENDOH <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
<p>=end</p> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=133392010-09-14T16:06:09Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=191852011-07-16T07:23:12Zzenspider (Ryan Davis)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Open</i></li><li><strong>Assignee</strong> deleted (<del><i>zenspider (Ryan Davis)</i></del>)</li></ul><p>I agree with Benoit. -w is there for a reason. If you're willing to ignore warnings coming from ruby, why would adding another line that says essentially the same thing be any better?</p>
<p>Regardless, I don't maintain test/unit, but I vote that this ticket be rejected.</p> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=247022012-03-18T15:11:03Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Assignee</strong> set to <i>sorah (Sorah Fukumori)</i></li></ul><p>Shota, please handle this. We also added you as a maintainer of test/unit. <a href="http://bugs.ruby-lang.org/projects/ruby/wiki/Maintainers" class="external">http://bugs.ruby-lang.org/projects/ruby/wiki/Maintainers</a></p> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=248572012-03-18T18:46:38Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Feature #2643: test/unit redefinition check of test_* methodhttps://bugs.ruby-lang.org/issues/2643?journal_id=282452012-07-21T14:12:35Zsorah (Sorah Fukumori)her@sorah.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r36484.<br>
Yusuke, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>lib/test/unit.rb: warn when test_* method is redefined.<br>
Patch by mame (Yusuke Endoh). [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: test/unit redefinition check of test_* method (Closed)" href="https://bugs.ruby-lang.org/issues/2643">#2643</a>] <a href="/issues/2643">[ruby-core:27790]</a></p>
</li>
<li>
<p>test/testunit/test_redefinition.rb: Test for above.</p>
</li>
<li>
<p>test/testunit/test4test_redefinition.rb: Ditto.</p>
</li>
</ul>