mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use capture_output instead of capture_io
This commit is contained in:
parent
be04006c7d
commit
ec6f04c092
4 changed files with 6 additions and 6 deletions
|
@ -79,7 +79,7 @@ class TestEnumerator < Test::Unit::TestCase
|
|||
assert_raise(NoMethodError) { enum.each {} }
|
||||
enum.freeze
|
||||
assert_raise(ArgumentError) {
|
||||
capture_io do
|
||||
capture_output do
|
||||
# warning: Enumerator.new without a block is deprecated; use Object#to_enum
|
||||
enum.__send__(:initialize, @obj, :foo)
|
||||
end
|
||||
|
|
|
@ -764,7 +764,7 @@ EXPECTED
|
|||
|
||||
$VERBOSE = true
|
||||
|
||||
_, err = capture_io do
|
||||
_, err = capture_output do
|
||||
assert_equal "\000", [0].pack("*U")
|
||||
end
|
||||
|
||||
|
@ -783,7 +783,7 @@ EXPECTED
|
|||
|
||||
$VERBOSE = true
|
||||
|
||||
_, err = capture_io do
|
||||
_, err = capture_output do
|
||||
assert_equal [0], "\000".unpack("*U")
|
||||
end
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ module Test
|
|||
# See also: #assert_silent
|
||||
|
||||
def assert_output stdout = nil, stderr = nil
|
||||
out, err = capture_io do
|
||||
out, err = capture_output do
|
||||
yield
|
||||
end
|
||||
|
||||
|
|
|
@ -1070,11 +1070,11 @@ class TestMiniTestUnitTestCase < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_capture_io
|
||||
def test_capture_output
|
||||
@assertion_count = 0
|
||||
|
||||
non_verbose do
|
||||
out, err = capture_io do
|
||||
out, err = capture_output do
|
||||
puts 'hi'
|
||||
$stderr.puts 'bye!'
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue