From 17667c03d058f0b542e724ad7038480a1cdcb046 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 26 Apr 2013 22:23:45 +0100 Subject: [PATCH] Add deps target to tests Rakefile for needed gems. --- Library/Homebrew/test/Rakefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Library/Homebrew/test/Rakefile b/Library/Homebrew/test/Rakefile index 1a9b26f920..cfb3d7d97c 100644 --- a/Library/Homebrew/test/Rakefile +++ b/Library/Homebrew/test/Rakefile @@ -4,11 +4,20 @@ require 'pathname' TEST_DIRECTORY = Pathname.new(File.expand_path(__FILE__)).parent.realpath TEST_FILES = FileList["#{TEST_DIRECTORY}/test_*.rb"] +GEM_DEPS = ['mocha'] Dir.chdir(TEST_DIRECTORY) task :default => :test +task :deps do + GEM_DEPS.each do |dep| + `gem list --installed #{dep}` + next if $?.success? + sh 'gem', 'install', '--no-ri', '--no-rdoc', '--user-install', dep + end +end + Rake::TestTask.new(:test) do |t| t.libs << Dir.pwd t.test_files = TEST_FILES