Call original backtick using super
This commit is contained in:
parent
43cb0b9141
commit
3dbcba0c03
@ -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}"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user