-->

为什么是后卫停止?(Why is guard stopping?)

2019-08-02 04:42发布

我有我只是把后卫和MINITEST和我gaurd文件是Rails应用程序

guard 'minitest', :cli => '--drb --format doc --color' do
  # with Minitest::Unit
  watch(%r|^test/(.*)\/?test_(.*)\.rb|)
  watch(%r|^lib/(.*)([^/]+)\.rb|)     { |m| "test/#{m[1]}test_#{m[2]}.rb" }
  watch(%r|^test/test_helper\.rb|)    { "test" }

  # Rails
  watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
  watch(%r|^app/helpers/(.*)\.rb|)     { |m| "test/helpers/#{m[1]}_test.rb" }
  watch(%r|^app/models/(.*)\.rb|)      { |m| "test/unit/#{m[1]}_test.rb" }  
end

但是当我跑卫,我收到了命令提示符

bundle exec guard
22:14:12 - INFO - Guard uses TerminalTitle to send notifications.
22:14:12 - INFO - Guard is now watching at '/Users/trace/Sites/application'
1.9.3 (main):0 > 2 + 2
=> 4

为什么我会收到此提示。 任何想法...这里有一些我使用的宝石

更新中...

当我运行all minitest然后运行的测试......但为什么我一定要运行...任何想法

Answer 1:

什么你看到的是后卫交互器,这使得利用撬 。 通常情况下,提示看起来有点不同的,所以我想你已经一个~/.pryrc一些配置文件。 具有保护1.5.3,昨天发布,保护忽略~/.pryrc和只判断~/.guardrc为撬配置,所以正常撬结构从Guard撬相互作用物分离。

当你看到这个提示,这意味着卫队正在等待与无关。 您现在可以开始工作和保护会自动启动,根据您的文件的修改和观察家配置与MINITEST测试您的应用程序,也可以手动触发一个动作。

你可以利用可用的操作列表help guard 。 一些命令取决于您在您卫队插件和组所产生Guardfile 。 下面是我的一个项目的例子:

$ bundle exec guard 
09:58:14 - INFO - Guard uses GNTP to send notifications.
09:58:14 - INFO - Guard is now watching at '/Users/michi/Repositories/extranett'
09:58:15 - INFO - Guard::Jasmine starts Unicorn test server on port 8888 in development environment.
09:58:17 - INFO - Waiting for Jasmine test runner at http://dnndev.me:8888/jasmine
09:58:23 - INFO - Run all Jasmine suites
09:58:23 - INFO - Run Jasmine suite at http://dnndev.me:8888/jasmine
09:58:41 - INFO - Finished in 8.853 seconds
09:58:41 - INFO - 896 specs, 0 failures
09:58:41 - INFO - Done.
09:58:41 - INFO - Guard::RSpec is running
09:58:41 - INFO - LiveReload 1.6 is waiting for a browser to connect.
[1] guard(main)> help guard
Guard
  all                Run all plugins.
  backend            Run all backend
  change             Trigger a file change.
  coffeescript       Run all coffeescript
  frontend           Run all frontend
  jasmine            Run all jasmine
  livereload         Run all livereload
  notification       Toggles the notifications.
  pause              Toggles the file listener.
  reload             Reload all plugins.
  rspec              Run all rspec
  show               Show all Guard plugins.
[2] guard(main)> exit
09:59:39 - INFO - Guard::Jasmine stops server.
09:59:39 - INFO - Bye bye...


文章来源: Why is guard stopping?