Project

General

Profile

Actions

Backport #2405

closed

Test::Unit.runの条件判定が逆?

Added by sho-h (Sho Hashimoto) over 14 years ago. Updated almost 13 years ago.


Description

=begin
Test::Unit.runにtrueを代入すると、単体テストが自動実行されません。

test/unit.rbには以下のような説明があるので、trueを代入した時に自動実行
したいという意図があると考えました。どちらが正しいのでしょうか?

Automatically run tests at exit?

def self.run?
@run ||= false
end

もし不具合なら、以下のような修正になると考えています。

--- unit.rb 2007-02-13 08:01:19.000000000 +0900
+++ unit.rb 2009-11-26 18:18:01.000000000 +0900
@@ -268,13 +268,13 @@

    # Automatically run tests at exit?
    def self.run?
  •  @run ||= false
    
  •  @run ||= true
    
    end
    end
    end
at_exit do
  • unless $! || Test::Unit.run?
  • if $!.nil? && Test::Unit.run?
    exit Test::Unit::AutoRunner.run
    end
    end
    =end

Related issues 2 (0 open2 closed)

Related to Ruby 1.8 - Bug #2345: RDoc improvement for Test::UnitClosed11/08/2009Actions
Is duplicate of Backport187 - Backport #1980: Test::Unit.run= behaves contrary to documentationClosedshyouhei (Shyouhei Urabe)08/22/2009Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Category set to lib
  • Status changed from Open to Assigned
  • Assignee set to shyouhei (Shyouhei Urabe)

=begin
ドキュメントの誤りです。このrunは過去分詞なのでしょう。
=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 14 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r26096.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0