Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Run brew update before restore (fixes #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sanders committed Jan 14, 2015
1 parent 2d00f7e commit 6f4b2cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cider/_sh.py
Expand Up @@ -92,6 +92,9 @@ def uses(self, formula):
"uses", args, check_output=True
).strip().split("\n")

def update(self):
return self.__spawn("update", [])


class Defaults(object):
def __init__(self, debug=None, env=None):
Expand Down
1 change: 1 addition & 0 deletions cider/core.py
Expand Up @@ -214,6 +214,7 @@ def restore(self, ignore_errors=None):
dependencies = bootstrap.get("dependencies", {})

self.run_scripts(before=True)
homebrew.update()

for tap in bootstrap.get("taps", []):
homebrew.tap(tap)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_sh.py
Expand Up @@ -116,6 +116,13 @@ def test_uses(self, cask, debug, verbose, formula):
env=brew.env)
sh.spawn.return_value = old_return

def test_update(self, cask, debug, verbose):
brew = Brew(cask, debug, verbose)
args = self.__cmd(cask) + ["update"] + self.__flags(debug, verbose)
brew.update()
sh.spawn.assert_called_with(args, debug=debug, check_output=False,
env=brew.env)

@staticmethod
def __cmd(cask=None):
return ["brew"] + (["cask"] if cask else [])
Expand Down

0 comments on commit 6f4b2cf

Please sign in to comment.