aboutsummaryrefslogtreecommitdiffstats
path: root/test/benchmark
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-08 17:19:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-08 17:19:23 +0900
commitb39efb163dd97a6b2c92cac3d2b1c19f898d0c04 (patch)
treea713be83c67c47c0f31a3601d640210c34f10fc5 /test/benchmark
parent1ad0f4e593563d460e3015fc4a2542ce1bb80d6e (diff)
downloadruby-b39efb163dd97a6b2c92cac3d2b1c19f898d0c04.tar.gz
Aliases capture_output to capture_io for test-unit compatiblity.
Diffstat (limited to 'test/benchmark')
-rw-r--r--test/benchmark/test_benchmark.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/benchmark/test_benchmark.rb b/test/benchmark/test_benchmark.rb
index 655c6946e7..0eb331a1cd 100644
--- a/test/benchmark/test_benchmark.rb
+++ b/test/benchmark/test_benchmark.rb
@@ -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)