test/test_idgxmlmaker_cmd.rb in review-5.0.0 vs test/test_idgxmlmaker_cmd.rb in review-5.1.0
- old
+ new
@@ -3,18 +3,18 @@
require 'fileutils'
require 'yaml'
require 'rbconfig'
require 'open3'
-REVIEW_IDGXMLMAKER = File.expand_path('../bin/review-idgxmlmaker', File.dirname(__FILE__))
+REVIEW_IDGXMLMAKER = File.expand_path('../bin/review-idgxmlmaker', __dir__)
class IDGXMLMakerCmdTest < Test::Unit::TestCase
def setup
@tmpdir1 = Dir.mktmpdir
@old_rubylib = ENV['RUBYLIB']
- ENV['RUBYLIB'] = File.expand_path('../lib', File.dirname(__FILE__))
+ ENV['RUBYLIB'] = File.expand_path('../lib', __dir__)
end
def teardown
FileUtils.rm_rf(@tmpdir1)
ENV['RUBYLIB'] = @old_rubylib
@@ -27,10 +27,14 @@
assert !File.exist?(builddir)
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}")
- assert_equal '', e
+ if defined?(ReVIEW::TTYLogger)
+ assert_match(/SUCCESS/, e)
+ else
+ assert_equal '', e
+ end
assert s.success?
end
assert File.exist?(File.join(@tmpdir1, targetfile))
end
end