From f45d557b9715e33e6b85c296d8bd6d9712c00990 Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Sun, 16 Aug 2020 15:53:57 +0900 Subject: [PATCH] mute some stderr outputs in tests. --- test/test_idgxmlmaker_cmd.rb | 3 +-- test/test_latexbuilder.rb | 4 ++++ test/test_textmaker_cmd.rb | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_idgxmlmaker_cmd.rb b/test/test_idgxmlmaker_cmd.rb index 5a6e60d03..48be00e9b 100644 --- a/test/test_idgxmlmaker_cmd.rb +++ b/test/test_idgxmlmaker_cmd.rb @@ -28,8 +28,7 @@ def common_buildidgxml(bookdir, configfile, targetfile, option) ruby_cmd = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) + RbConfig::CONFIG['EXEEXT'] Dir.chdir(@tmpdir1) do - _o, e, s = Open3.capture3("#{ruby_cmd} -S #{REVIEW_IDGXMLMAKER} #{option} #{configfile}") - STDERR.puts e unless e.empty? + _o, _e, s = Open3.capture3("#{ruby_cmd} -S #{REVIEW_IDGXMLMAKER} #{option} #{configfile}") assert s.success? end assert File.exist?(File.join(@tmpdir1, targetfile)) diff --git a/test/test_latexbuilder.rb b/test/test_latexbuilder.rb index b3608ba7a..a515dcbf0 100644 --- a/test/test_latexbuilder.rb +++ b/test/test_latexbuilder.rb @@ -1285,6 +1285,9 @@ def path item end + io = StringIO.new + @builder.instance_eval{ @logger = ReVIEW::Logger.new(io) } + actual = compile_block("//indepimage[sample_img#&][sample photo]\n") expected = <<-EOS \\begin{reviewdummyimage} @@ -1293,6 +1296,7 @@ def path \\end{reviewdummyimage} EOS assert_equal expected, actual + assert_match(/WARN --: :1: image not bound: sample_img#&/, io.string) end def test_table diff --git a/test/test_textmaker_cmd.rb b/test/test_textmaker_cmd.rb index 77cc9e5b3..e18611d2a 100644 --- a/test/test_textmaker_cmd.rb +++ b/test/test_textmaker_cmd.rb @@ -28,8 +28,7 @@ def common_buildtext(bookdir, configfile, targetfile, option) ruby_cmd = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) + RbConfig::CONFIG['EXEEXT'] Dir.chdir(@tmpdir1) do - _o, e, s = Open3.capture3("#{ruby_cmd} -S #{REVIEW_TEXTMAKER} #{option} #{configfile}") - STDERR.puts e unless e.empty? + _o, _e, s = Open3.capture3("#{ruby_cmd} -S #{REVIEW_TEXTMAKER} #{option} #{configfile}") assert s.success? end assert File.exist?(File.join(@tmpdir1, targetfile))