Call original backtick using super

This commit is contained in:
Jack Nagel 2014-06-23 18:50:55 -05:00
parent 43cb0b9141
commit 3dbcba0c03
2 changed files with 4 additions and 5 deletions

View File

@ -196,7 +196,7 @@ class Updater
end
def `(cmd)
out = Kernel.`(cmd) #`
out = super
if $? && !$?.success?
$stderr.puts out
raise ErrorDuringExecution, "Failure while executing: #{cmd}"

View File

@ -16,8 +16,8 @@ class UpdaterTests < Homebrew::TestCase
@outputs[cmd] << output
end
def `(cmd, *args)
cmd = "#{cmd} #{args*' '}".strip
def `(*args)
cmd = args.join(" ")
if @expected.include?(cmd) and !@outputs[cmd].empty?
@called << cmd
@outputs[cmd].shift
@ -25,8 +25,7 @@ class UpdaterTests < Homebrew::TestCase
raise "#{inspect} unexpectedly called backticks: `#{cmd}`"
end
end
alias safe_system ` #`
alias_method :safe_system, :`
def expectations_met?
@expected == @called