Guard Rspec:不推荐使用cli选项,更改为:cmd选项

Pat*_*ick 3 rspec ruby-on-rails guard

Guardfile在我的rails应用程序中工作

guard 'rspec', all_after_pass: false, cli: '--drb' do

不工作 Guardfile

guard 'rspec', all_after_pass: false, cmd: '--drb' do

我已bundle exec guard多次打开警卫,但我发现即使我收到此消息 Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. 并进行了适当的更改,:cli是唯一一个使用rspec的人.

终端输出 :cli

01:49:14 - WARN - Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need.
01:49:15 - INFO - Guard is using Growl to send notifications.
01:49:15 - INFO - Guard is using Emacs to send notifications.
01:49:15 - INFO - Guard is using TerminalTitle to send notifications.
01:49:15 - INFO - Starting Spork for RSpec
Using RSpec, Rails
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
01:49:17 - INFO - Spork server for RSpec successfully started

01:49:17 - INFO - Guard::RSpec is running
01:49:17 - INFO - Guard is now watching at '/Users/me/rails_projects/mvp'
[1] guard(main)> 
01:49:18 - INFO - Run all
01:49:18 - INFO - Running all specs
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter", "--require", "/Users/me/.rvm/gems/ruby-2.1.0@rails40/gems/guard-rspec-4.2.4/lib/guard/rspec/formatter.rb", "spec"]...
......................................................................

Finished in 0.76464 seconds
70 examples, 0 failures

Randomized with seed 47137

Done.
Run Code Online (Sandbox Code Playgroud)

终端输出 :cmd

bundle exec guard
01:58:55 - INFO - Guard is using Growl to send notifications.
01:58:55 - INFO - Guard is using Emacs to send notifications.
01:58:55 - INFO - Guard is using TerminalTitle to send notifications.
01:58:55 - INFO - Starting Spork for RSpec
Using RSpec, Rails
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
01:58:57 - INFO - Spork server for RSpec successfully started

01:58:57 - INFO - Guard::RSpec is running
01:58:57 - INFO - Guard is now watching at '/Users/me/rails_projects/mvp'
[1] guard(main)> 
01:58:59 - INFO - Run all
01:58:59 - INFO - Running all specs

[2] guard(main)> 
Run Code Online (Sandbox Code Playgroud)

离开:cli或有解决方案吗?

Pat*_*ick 11

:cmd需要执行自定义的内容以满足我的需求.正如@sevenseacat所说,"你没有根据自己的需要定制它 - 你只是将cli复制到cmd并期望它能够工作"

我正在运行Spork,Guard和Rspec进行测试.而不是只写--drb我应该先加上它rspec

固定Guardfile有

guard 'rspec', all_after_pass: false, cmd: 'rspec --drb' do