#!/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_VERSION='0.3t' HOMEBREW_CACHE="/tmp/testbrew" HOMEBREW_PREFIX=Pathname.new(HOMEBREW_CACHE)+'prefix' HOMEBREW_CELLAR=Pathname.new(HOMEBREW_CACHE)+'cellar' HOMEBREW_CELLAR.mkpath raise "HOMEBREW_CELLAR couldn't be created!" unless HOMEBREW_CELLAR.directory? at_exit { Pathname.new(HOMEBREW_CACHE).rmtree } require 'test/unit' # must be after at_exit class TestFormula #{path}` assert_not_nil Formula.create(FOOBAR) end def test_cant_override_brew assert_raises(RuntimeError) { TestBallOverrideBrew.new } end end