Guard Rspec :cli 选项已弃用,更改为 :cmd 选项 [英] Guard Rspec :cli option is deprecated, change to :cmd option
问题描述
在我的 rails 应用程序中运行 Guardfile
Working Guardfile
in my rails app
guard 'rspec', all_after_pass: false, cli: '--drb' do
不工作Guardfile
guard 'rspec', all_after_pass: false, cmd: '--drb' do
我已经多次使用 bundle exec guard
打开了守卫,但我发现即使我收到此消息Guard::RSpec 弃用警告:不推荐使用 :cli 选项.请自定义新的 :cmd 选项以满足您的需要.
并且我进行了适当的更改,:cli 是唯一使用 rspec 的更改.
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.
: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.
: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)>
离开 :cli
还是有解决办法?
Just leave the :cli
or is there a solution?
推荐答案
:cmd 需要执行一些定制以满足我的需要.正如@sevenseacat 所说,您没有自定义它以满足您的需求 - 您只是将 cli 复制到 cmd 并希望它能够工作"
: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"
我正在运行 Spork、Guard 和 Rspec 进行测试.而不是只写 --drb 我应该在它前面加上 rspec
I'm running Spork, Guard, and Rspec for testing. Instead of just writing --drb I should prepend it with rspec
固定的Guardfile有
Fixed Guardfile has
guard 'rspec', all_after_pass: false, cmd: 'rspec --drb' do
这篇关于Guard Rspec :cli 选项已弃用,更改为 :cmd 选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!