0

我正在使用 Test::Unit 来测试我的 rails 应用程序,当我进行“rake test”时一切都很好。但是,运行“bundle exec guard”时,我遇到了很多失败和错误(链接到我的应用程序所需的种子),并且我的数据库都是空的(没有种子数据)。

Guard 有何不同之处?我需要在我的 Guardfile 中添加一些内容吗?

我的 Guardfile 看起来像这样(我认为这是你做 Guard init 时的默认设置):

guard :test do

  watch(%r{^lib/(.+)\.rb$})     { |m| "test/#{m[1]}_test.rb" }
  watch(%r{^test/.+_test\.rb$})
  watch('test/test_helper.rb')  { "test" }

  # Rails example
  watch(%r{^app/models/(.+)\.rb$})                   { |m| "test/unit/#{m[1]}_test.rb" }
  watch(%r{^app/controllers/(.+)\.rb$})              { |m| "test/functional/#{m[1]}_test.rb" }
  watch(%r{^app/views/.+\.rb$})                      { "test/integration" }
  watch('app/controllers/application_controller.rb') { ["test/functional", "test/integration"] }
end
4

0 回答 0