【发布时间】:2014-06-22 14:21:39
【问题描述】:
打电话给bundle exec rake 或bundle exec make 在我看来很奇怪:为什么不呢
bundle exec bundle exec rake
然后呢?
虽然我应该能够从 Rakefile(或 Makefile)中要求和使用 Bundler。但是,我找不到如何使用正确的宝石组运行测试,以下不起作用:
# Rakefile
require 'rake/testtask'
Rake::TestTask.new do |t|
require 'bundler'
Bundler.setup(:default, :test) # this has no effect
t.test_files = FileList['test.rb']
end
有人可以帮助我正确设置 Rake 测试任务,或者解释使用 bundle exec rake 的哲学原因吗?
注意bundle exec rake 需要将gem rake 添加到 Gemfile。
【问题讨论】:
标签: ruby testing rake bundler rake-task