Bug #3852

test_prime.rb:62が通らない

Added by Shota Fukumori over 3 years ago. Updated almost 3 years ago.

[ruby-dev:42272]
Status:Closed
Priority:Normal
Assignee:Yuki Sonoda
Category:test
Target version:1.9.3
ruby -v:ruby 1.9.3dev (2010-09-21 trunk 29308) [x86_64-darwin10.4.0] Backport:

Description

=begin
test_prime.rb:62が以下のように通りませんでした。

1) Error:
testnew(TestPrime):
IOError: not opened for reading
../../test/test
prime.rb:62:in read'
../../test/test_prime.rb:62:in
test_new'

パッチは以下です。

diff --git test/testprime.rb test/testprime.rb
index e095a29..dca9295 100644
--- test/testprime.rb
+++ test/test
prime.rb
@@ -55,7 +55,7 @@ class TestPrime < Test::Unit::TestCase
end

def test_new
  • buf = StringIO.new('', 'w')
  • buf = StringIO.new('', 'w+')
    orig, $stderr = $stderr, buf

    enum = Prime.new
    =end


Related issues

Related to ruby-trunk - Bug #3857: OpenSSL::TestUtils.silent が $VERBOSE を戻していない Closed 09/22/2010

History

#1 Updated by Yui NARUSE over 3 years ago

  • Status changed from Open to Feedback

=begin
うーん、再現しませんねぇ。
コード見てもreadしてない気がするし。
=end

#2 Updated by Shota Fukumori over 3 years ago

=begin
このパッチは無意味でした。なんでこれで通るようになったんだろう。

もう一度試してみたら、make test-allの時にのみ再現します。
このIO系の奴はもう一つあるんだな。

7) Failure
testcaptureio(TestMiniTestTestCase) [/Users/sorah/git/ruby/core/test/minitest/testminitest.rb:837]:
Expected "bye!\n", not "".

たぶんこれもmake test-allのみ?

--
ruby -v: ruby 1.9.3dev (2010-09-21 trunk 29308) [x86_64-darwin10.4.0]
=end

#3 Updated by Kazuhiro NISHIYAMA over 3 years ago

  • Category set to test
  • Target version set to 1.9.3
  • ruby -v set to ruby 1.9.3dev (2010-09-21 trunk 29308) [x86_64-darwin10.4.0]

=begin

=end

#4 Updated by Shota Fukumori over 3 years ago

=begin
パッチ完成しました。コミットお願いします

diff --git test/testprime.rb test/testprime.rb
index e095a29..4662b97 100644
--- test/testprime.rb
+++ test/test
prime.rb
@@ -58,8 +58,10 @@ class TestPrime < Test::Unit::TestCase
buf = StringIO.new('', 'w')
orig, $stderr = $stderr, buf

  • orig_verbose, $VERBOSE = $VERBOSE, false enum = Prime.new assert !buf.string.empty?
  • $VERBOSE = orig_verbose
    $stderr = orig

    assert enum.respond_to?(:each)
    =end

#5 Updated by Yuki Sonoda over 3 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

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

=end

Also available in: Atom PDF