Guard Rspec :cli option is deprecated, change to :cmd option

青春壹個敷衍的年華 提交于 2019-12-10 20:54:51

问题


Working Guardfilein my rails app

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

Not working Guardfile

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

I've opened guard with bundle exec guard many times, but I found even though I receive this message Guard::RSpec DEPRECATION WARNING: The :cli option is deprecated. Please customize the new :cmd option to fit your need. and I make the proper changes, :cli is the only one working with rspec.

terminal output for :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.

terminal output for :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)> 

Just leave the :cli or is there a solution?


回答1:


:cmd needs to execute something that is customized to fit my needs. As @sevenseacat said, "You didn't customize it to fit your needs - you just copied the cli to cmd and expected it to work"

I'm running Spork, Guard, and Rspec for testing. Instead of just writing --drb I should prepend it with rspec

Fixed Guardfile has

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



来源:https://stackoverflow.com/questions/21215357/guard-rspec-cli-option-is-deprecated-change-to-cmd-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!