Project

General

Profile

Actions

Bug #3856

closed

test_capture_io (test/minitest/test_mini_test.rb:837)が通らない

Added by sorah (Sorah Fukumori) over 14 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-09-22 trunk 29314) [x86_64-darwin10.4.0]
Backport:

Description

=begin
sora_hです。

test/minitest/test_minitest.rb:837 / test_capture_ioが通りません。

パッチは以下です。 #3852と同じ方法で修正がききます。

diff --git test/minitest/test_mini_test.rb test/minitest/test_mini_test.rb
index 1cbc829..3a6b897 100644
--- test/minitest/test_mini_test.rb
+++ test/minitest/test_mini_test.rb
@@ -828,10 +828,12 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
def test_capture_io
@assertion_count = 0

  • orig_verbose, $VERBOSE = $VERBOSE, false
    out, err = capture_io do
    puts 'hi'
    warn 'bye!'
    end

  • $VERBOSE = orig_verbose

    assert_equal "hi\n", out
    assert_equal "bye!\n", err
    =end


Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #3857: OpenSSL::TestUtils.silent が $VERBOSE を戻していないClosed09/22/2010Actions
Related to Ruby master - Bug #3858: test_capture_io (test/minitest/test_mini_test.rb:837) doesn't passClosedzenspider (Ryan Davis)09/22/2010Actions
Actions #1

Updated by sorah (Sorah Fukumori) over 14 years ago

=begin
指摘をうけてensureで戻すように変更しました。
追記すると、$VERBOSEがnilのときにこれは動作しなくなるのでそれの対策をしています
(たとえば、testが狂っていて$VERBOSEをnilにしたままになっている等。)

diff --git test/minitest/test_mini_test.rb test/minitest/test_mini_test.rb
index 1cbc829..bed0521 100644
--- test/minitest/test_mini_test.rb
+++ test/minitest/test_mini_test.rb
@@ -828,6 +828,8 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
def test_capture_io
@assertion_count = 0

  • orig_verbose = $VERBOSE

  • $VERBOSE = false
    out, err = capture_io do
    puts 'hi'
    warn 'bye!'
    @@ -835,6 +837,8 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'

    assert_equal "hi\n", out
    assert_equal "bye!\n", err

  • ensure

  • $VERBOSE = orig_verbose
    end

def test_class_asserts_match_refutes

=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 14 years ago

=begin
内容自体はよいと思うのですが、minitestは外部レポジトリで開発されているので、upstreamに報告してあげる必要があるでしょう。
=end

Actions #3

Updated by usa (Usaku NAKAMURA) over 14 years ago

  • Status changed from Open to Closed

=begin
#3858 に行ったようなのでこちらはclose。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0