2012-11-01 90 views
7

我有,我只是把后卫Rails应用程序和MINITEST和我gaurd文件卫兵为什么停下来?

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 

命令为什么会出现这样的提示。任何想法...这里是一些宝石的我使用

UPDATE ...

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

回答

7

你看到的是Guard交互者,它使用了Pry。通常情况下,提示看起来有点不同,所以我认为你已经有一个~/.pryrc文件的某些配置。在昨天发布的Guard 1.5.3版中,Guard忽略了~/.pryrc并且只对Pry配置评估~/.guardrc,所以正常的Pry配置与Guard Pry交互器分离。

当你看到这个提示时,这意味着守卫正在等待,并没有任何关系。您现在可以开始工作了,Guard会根据您的文件修改和观察器配置自动开始使用minitest测试您的应用程序,或者您可以手动触发操作。

您可以通过help guard获得可用操作的列表。根据您的Guard插件和您的Guardfile中的组生成一些命令。下面是我的一个项目的例子:开始撬时prompt`选项:

$ 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... 
+0

如果你想使用的后卫有其自己的提示(独立于.pryrc指定的)具体实例撬然后传递' https://github.com/pry/pry/wiki/Customization-and-configuration#wiki-Config_per_instance(忽略'prompt_name'选项,这将不会提供,直到下一个版本) – horseyguy

+0

@Netxpirat - 有没有办法停止这个,只是有警惕的火,当我做出像以前一样的变化 – Trace

+9

@Trace是的,你可以通过'-i'选项来防范和禁用交互器:'bundle exec guard -i' – Netzpirat