Call original backtick using super
This commit is contained in:
parent
43cb0b9141
commit
3dbcba0c03
@ -196,7 +196,7 @@ class Updater
|
|||||||
end
|
end
|
||||||
|
|
||||||
def `(cmd)
|
def `(cmd)
|
||||||
out = Kernel.`(cmd) #`
|
out = super
|
||||||
if $? && !$?.success?
|
if $? && !$?.success?
|
||||||
$stderr.puts out
|
$stderr.puts out
|
||||||
raise ErrorDuringExecution, "Failure while executing: #{cmd}"
|
raise ErrorDuringExecution, "Failure while executing: #{cmd}"
|
||||||
|
@ -16,8 +16,8 @@ class UpdaterTests < Homebrew::TestCase
|
|||||||
@outputs[cmd] << output
|
@outputs[cmd] << output
|
||||||
end
|
end
|
||||||
|
|
||||||
def `(cmd, *args)
|
def `(*args)
|
||||||
cmd = "#{cmd} #{args*' '}".strip
|
cmd = args.join(" ")
|
||||||
if @expected.include?(cmd) and !@outputs[cmd].empty?
|
if @expected.include?(cmd) and !@outputs[cmd].empty?
|
||||||
@called << cmd
|
@called << cmd
|
||||||
@outputs[cmd].shift
|
@outputs[cmd].shift
|
||||||
@ -25,8 +25,7 @@ class UpdaterTests < Homebrew::TestCase
|
|||||||
raise "#{inspect} unexpectedly called backticks: `#{cmd}`"
|
raise "#{inspect} unexpectedly called backticks: `#{cmd}`"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
alias_method :safe_system, :`
|
||||||
alias safe_system ` #`
|
|
||||||
|
|
||||||
def expectations_met?
|
def expectations_met?
|
||||||
@expected == @called
|
@expected == @called
|
||||||
|
Loading…
x
Reference in New Issue
Block a user