加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 无法在Rails中使用guard-minitest

发布时间:2020-12-17 04:36:41 所属栏目:百科 来源:网络整理
导读:我开始在我的Rails项目中使用MiniTest. 当我进行弹簧耙试验时,测试工作正常. 但是我无法通过守卫 – minitest进行测试. bundle exec guard05:03:24 - INFO - Guard::Minitest 2.4.6 is running,with Minitest::Unit 5.9.0!05:03:24 - INFO - Running: all te
我开始在我的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中.

我可以在何处以及如何正确配置以通过防护来查看测试文件?

解决方法

我想这里的问题是在看块
你能尝试设置这样的块:
guard 'minitest',cmd: 'spring rake test' do
  watch('company.rb') { 'company_test.rb' }
  watch('company_test.rb')
enв

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读