mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/test_prime.rb (TestPrime#test_new): the warning expected have
not been displayed when $VERBOSE == nil. Patch by Shota Fukumori a.k.a. sora_h. [ruby-dev:42272] Recovers $stderr even if StringIO.new fails. Reported by unak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e2c1e2969d
commit
a33353f880
2 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
Wed Sep 22 16:59:40 2010 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* test/test_prime.rb (TestPrime#test_new): the warning expected have
|
||||
not been displayed when $VERBOSE == nil. Patch by Shota Fukumori
|
||||
a.k.a. sora_h. [ruby-dev:42272]
|
||||
Recovers $stderr even if StringIO.new fails. Reported by unak.
|
||||
|
||||
Wed Sep 22 01:55:48 2010 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* bootstraptest/test_method.rb: fix last commit.
|
||||
|
|
|
@ -55,12 +55,13 @@ class TestPrime < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_new
|
||||
buf = StringIO.new('', 'w')
|
||||
orig, $stderr = $stderr, buf
|
||||
orig_stderr, orig_verbose = $stderr, $VERBOSE
|
||||
|
||||
$stderr = buf = StringIO.new('', 'w')
|
||||
$VERBOSE = false
|
||||
|
||||
enum = Prime.new
|
||||
assert !buf.string.empty?
|
||||
$stderr = orig
|
||||
assert_match("obsolete", buf.string)
|
||||
|
||||
assert enum.respond_to?(:each)
|
||||
assert enum.kind_of?(Enumerable)
|
||||
|
@ -68,7 +69,8 @@ class TestPrime < Test::Unit::TestCase
|
|||
|
||||
assert Prime === enum
|
||||
ensure
|
||||
$stderr = orig
|
||||
$stderr = orig_stderr
|
||||
$VERBOSE = orig_verbose
|
||||
end
|
||||
|
||||
def test_enumerator_succ
|
||||
|
|
Loading…
Reference in a new issue