Add deps target to tests Rakefile for needed gems.
This commit is contained in:
parent
f4cf04b95e
commit
17667c03d0
@ -4,11 +4,20 @@ require 'pathname'
|
|||||||
|
|
||||||
TEST_DIRECTORY = Pathname.new(File.expand_path(__FILE__)).parent.realpath
|
TEST_DIRECTORY = Pathname.new(File.expand_path(__FILE__)).parent.realpath
|
||||||
TEST_FILES = FileList["#{TEST_DIRECTORY}/test_*.rb"]
|
TEST_FILES = FileList["#{TEST_DIRECTORY}/test_*.rb"]
|
||||||
|
GEM_DEPS = ['mocha']
|
||||||
|
|
||||||
Dir.chdir(TEST_DIRECTORY)
|
Dir.chdir(TEST_DIRECTORY)
|
||||||
|
|
||||||
task :default => :test
|
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|
|
Rake::TestTask.new(:test) do |t|
|
||||||
t.libs << Dir.pwd
|
t.libs << Dir.pwd
|
||||||
t.test_files = TEST_FILES
|
t.test_files = TEST_FILES
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user