我开始在我的Rails项目中使用MiniTest.
当我进行弹簧耙试验时,测试工作正常.
但是我无法通过守卫 – 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'
Guardfile
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
我写了测试文件名目录,以避免正则表达式failer.
测试文件位于test / models / company_test.rb中.
我可以在何处以及如何正确配置以通过防护来查看测试文件?
解决方法@H_502_18@
我想这里的问题是在看块
你能尝试设置这样的块:
guard 'minitest',cmd: 'spring rake test' do
watch('company.rb') { 'company_test.rb' }
watch('company_test.rb')
enв
你能尝试设置这样的块:
guard 'minitest',cmd: 'spring rake test' do watch('company.rb') { 'company_test.rb' } watch('company_test.rb') enв