Skip to content

Commit

Permalink
define global shutup method (temporary)
Browse files Browse the repository at this point in the history
solves the following error:
```bash
$ bundle exec rake test
...
NoMethodError: undefined method `shutup'
...
```

This is not a permanent solution.  The test suite should be changed
around to find the new `shutup` method, which is still in Homebrew,
but no longer global.
  • Loading branch information
rolandwalker committed Jun 19, 2014
1 parent 04a84b5 commit 62fff58
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@
# require homebrew testing env
require 'test/testing_env'

# todo temporary, copied from old Homebrew, this method is now moved inside a class
def shutup
if ARGV.verbose?
yield
else
begin
tmperr = $stderr.clone
tmpout = $stdout.clone
$stderr.reopen '/dev/null', 'w'
$stdout.reopen '/dev/null', 'w'
yield
ensure
$stderr.reopen tmperr
$stdout.reopen tmpout
end
end
end

# making homebrew's cache dir allows us to actually download casks in tests
HOMEBREW_CACHE.mkpath
HOMEBREW_CACHE.join('Casks').mkpath
Expand Down

0 comments on commit 62fff58

Please sign in to comment.