gpt4 book ai didi

ruby-on-rails - 不能在 Rails 中使用 guard-minitest

转载 作者:行者123 更新时间:2023-12-04 08:54:45 30 4
gpt4 key购买 nike

我开始使用 MiniTest在我的 Rails 项目中。

当我跑 spring rake test ,测试工作正常。
但我无法通过 guard-minitest 运行测试.

bundle exec guard
05:03:24 - INFO - Guard::Minitest 2.4.6 is running, with Minitest::Unit 5.9.0!
05:03:24 - INFO - Running: all tests
Run options: -n spec/apis/user_spec.rb --seed 22566

# Running:



Finished in 0.004998s, 0.0000 runs/s, 0.0000 assertions/s.

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips

05:03:25 - INFO - Guard is now watching at '/Users/ironsand/dev/my_project'

保护文件
guard :minitest, spring: 'spring rake test' do
watch(%r{^test/models/company_test.rb$})
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
watch(%r{^test/test_helper\.rb$}) { 'test' }
end

我写了测试文件名目录以避免正则表达式失败。
测试文件在 test/models/company_test.rb .

我在哪里以及如何正确配置以通过 guard 观看测试文件?

最佳答案

我猜这里的问题出在 watch 块上
你能不能尝试这样设置块:

guard 'minitest', cmd: 'spring rake test' do
watch('company.rb') { 'company_test.rb' }
watch('company_test.rb')
enв

关于ruby-on-rails - 不能在 Rails 中使用 guard-minitest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39420387/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com