Bug #3852
closedtest_prime.rb:62が通らない
Description
=begin
test_prime.rb:62が以下のように通りませんでした。
- Error:
test_new(TestPrime):
IOError: not opened for reading
../../test/test_prime.rb:62:inread' ../../test/test_prime.rb:62:in
test_new'
パッチは以下です。
diff --git test/test_prime.rb test/test_prime.rb
index e095a29..dca9295 100644
--- test/test_prime.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, bufenum = Prime.new
=end
Updated by naruse (Yui NARUSE) about 14 years ago
- Status changed from Open to Feedback
=begin
うーん、再現しませんねぇ。
コード見てもreadしてない気がするし。
=end
Updated by sorah (Sorah Fukumori) about 14 years ago
=begin
このパッチは無意味でした。なんでこれで通るようになったんだろう。
もう一度試してみたら、make test-allの時にのみ再現します。
このIO系の奴はもう一つあるんだな。
- Failure
test_capture_io(TestMiniTestTestCase) [/Users/sorah/git/ruby/core/test/minitest/test_mini_test.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
Updated by znz (Kazuhiro NISHIYAMA) about 14 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
Updated by sorah (Sorah Fukumori) about 14 years ago
=begin
パッチ完成しました。コミットお願いします
diff --git test/test_prime.rb test/test_prime.rb
index e095a29..4662b97 100644
--- test/test_prime.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 = origassert enum.respond_to?(:each)
=end
Updated by yugui (Yuki Sonoda) about 14 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