1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Aliases capture_output to capture_io for test-unit compatiblity.

This commit is contained in:
Hiroshi SHIBATA 2019-08-08 17:19:23 +09:00
parent 1ad0f4e593
commit b39efb163d
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
5 changed files with 6 additions and 9 deletions

View file

@ -34,12 +34,8 @@ class TestBenchmark < Test::Unit::TestCase
end
end
def capture_output
capture_io { yield }.first.gsub(/[ \-]\d\.\d{6}/, ' --time--')
end
def capture_bench_output(type, *args, &block)
capture_output { bench(type, *args, &block) }
capture_output { bench(type, *args, &block) }.first.gsub(/[ \-]\d\.\d{6}/, ' --time--')
end
def test_tms_outputs_nicely
@ -85,7 +81,7 @@ BENCH
def test_bm_returns_an_Array_of_the_times_with_the_labels
[:bm, :bmbm].each do |meth|
capture_io do
capture_output do
results = bench(meth)
assert_instance_of(Array, results)
assert_equal(labels.size, results.size)