diff options
| author | Jack Nagel | 2014-06-10 20:03:57 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-10 20:04:51 -0500 |
| commit | 0dc018c94cf10eb8151ee20c53964c176af4a779 (patch) | |
| tree | 79d7fd1df38c451a9a09ee889c99eb6012f11974 /Library | |
| parent | eb9d1386c77ce45f9364bf4d0e6c456167988e3c (diff) | |
| download | homebrew-0dc018c94cf10eb8151ee20c53964c176af4a779.tar.bz2 | |
Pull mock initialization code into initialize
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/test_updater.rb | 10 |
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 |
