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

Use EXEEXT

* test/lib/minitest/unit.rb (MiniTest::Assertions.diff): use
  `EXEEXT` configured value instead of switching by hard coded
  `host_os`.
This commit is contained in:
Nobuyoshi Nakada 2019-06-22 23:44:19 +09:00
parent f738eeabc2
commit f5e2904471
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -79,18 +79,14 @@ module MiniTest
# figure out what diff to use.
def self.diff
@diff = if (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ &&
system("diff.exe", __FILE__, __FILE__)) then
"diff.exe -u"
elsif Minitest::Unit::Guard.maglev? then # HACK
"diff -u"
elsif system("gdiff", __FILE__, __FILE__)
"gdiff -u" # solaris and kin suck
elsif system("diff", __FILE__, __FILE__)
"diff -u"
else
nil
end unless defined? @diff
unless defined? @diff
exe = RbConfig::CONFIG['EXEEXT']
@diff = %W"gdiff#{exe} diff#{exe}".find do |diff|
if system(diff, "-u", __FILE__, __FILE__)
break "#{diff} -u"
end
end
end
@diff
end