Project

General

Profile

Backport #2405

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

Added by sho-h (Sho Hashimoto) over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:39792]

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

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
#1

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

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

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

#2

Updated by shyouhei (Shyouhei Urabe) over 10 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

Also available in: Atom PDF