Skip to content

Commit

Permalink
Use EXEEXT
Browse files Browse the repository at this point in the history
* test/lib/minitest/unit.rb (MiniTest::Assertions.diff): use
  `EXEEXT` configured value instead of switching by hard coded
  `host_os`.
  • Loading branch information
nobu committed Jun 22, 2019
1 parent f738eea commit f5e2904
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/lib/minitest/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,14 @@ module Assertions
# 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
Expand Down

0 comments on commit f5e2904

Please sign in to comment.