#!/usr/bin/ruby $:.unshift File.dirname(__FILE__) require 'formula' require 'keg' require 'pathname+yeast' require 'stringio' require 'utils' # these are defined in env.rb usually, but we don't want to break our actual # homebrew tree, and we do want to test everything :) HOMEBREW_PREFIX=Pathname.new '/tmp/testbrew/prefix' HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache" HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar" HOMEBREW_USER_AGENT="Homebrew" HOMEBREW_CELLAR.mkpath raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory? at_exit { HOMEBREW_PREFIX.parent.rmtree } require 'test/unit' # must be after at_exit class MockFormula #{path}` assert_not_nil Formula.create(FOOBAR) end def test_cant_override_brew assert_raises(RuntimeError) { TestBallOverrideBrew.new } end end