aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/test/test_updater.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/test/test_updater.rb b/Library/Homebrew/test/test_updater.rb
index 91c7fee0f..0d3cbc7fa 100644
--- a/Library/Homebrew/test/test_updater.rb
+++ b/Library/Homebrew/test/test_updater.rb
@@ -4,9 +4,14 @@ require 'yaml'
class UpdaterTests < Test::Unit::TestCase
class UpdaterMock < ::Updater
+ def initialize(*args)
+ super
+ @outputs = Hash.new { |h, k| h[k] = [] }
+ @expected = []
+ @called = []
+ end
+
def in_repo_expect(cmd, output = '')
- @outputs ||= Hash.new { |h,k| h[k] = [] }
- @expected ||= []
@expected << cmd
@outputs[cmd] << output
end
@@ -14,7 +19,6 @@ class UpdaterTests < Test::Unit::TestCase
def `(cmd, *args)
cmd = "#{cmd} #{args*' '}".strip
if @expected.include?(cmd) and !@outputs[cmd].empty?
- @called ||= []
@called << cmd
@outputs[cmd].shift
else