工作Guardfile
在我的Rails應用程序衛隊Rspec的:CLI選項已被棄用,更改爲:CMD選項
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.
a nd我做了適當的修改: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/[email protected]/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
或者是有一個解決方案?
你沒有定製,以滿足您的需求 - 你剛纔複製的'cli'爲'cmd'並預計它會工作 – sevenseacat
啊我看到我做錯了什麼。我會回答 – Patrick
我無法發佈答案,所以在這裏。 ':cmd'需要執行一些自定義的東西來滿足我的需求。正如@sevenseacat所說:「您沒有對其進行定製以滿足您的需求 - 您只是將cli複製到cmd並且預計它能正常工作」 我正在運行Spork,Guard和Rspec進行測試。 ''''''''''''''''''我不應該只是寫'--drb'我應該在'rspec'前加上' 修正'Guardfile'有 'guard'rspec',all_after_pass:false,cmd:'rspec --drb' – Patrick